Sorry Melanie...its me !!!!
Sorry Melanie !!!
Your code is NOT WRONG
I tried re-creating the formula in an Excel spreadsheed forcing results to be INT but it threw up wrong results all over the place.
I then took an alternative approace of getting the PIC to output its information so that I could stick it into a spreadsheet. I then got Excel to calculate the correct weekday for each of the dates. I cant see ANY discrepancies in the 7000+ rows although I havent looked at each one individually.
Here is the section containing the dates that I posted last night....
Code:
Date Weekday DayID RealDay
9-Sep-2006 Sat 5 Saturday
10-Sep-2006 Sun 6 Sunday
11-Sep-2006 Mon 7 Monday
12-Sep-2006 Tue 1 Tuesday
13-Sep-2006 Wed 2 Wednesday
14-Sep-2006 Thu 3 Thursday
15-Sep-2006 Fri 4 Friday
16-Sep-2006 Sat 5 Saturday
17-Sep-2006 Sun 6 Sunday
18-Sep-2006 Mon 7 Monday
19-Sep-2006 Tue 1 Tuesday
20-Sep-2006 Wed 2 Wednesday
21-Sep-2006 Thu 3 Thursday
22-Sep-2006 Fri 4 Friday
23-Sep-2006 Sat 5 Saturday
24-Sep-2006 Sun 6 Sunday
25-Sep-2006 Mon 7 Monday
26-Sep-2006 Tue 1 Tuesday
27-Sep-2006 Wed 2 Wednesday
28-Sep-2006 Thu 3 Thursday
29-Sep-2006 Fri 4 Friday
30-Sep-2006 Sat 5 Saturday
1-Oct-2006 Sun 6 Sunday
2-Oct-2006 Mon 7 Monday
3-Oct-2006 Tue 1 Tuesday
4-Oct-2006 Wed 2 Wednesday
5-Oct-2006 Thu 3 Thursday
6-Oct-2006 Fri 4 Friday
7-Oct-2006 Sat 5 Saturday
8-Oct-2006 Sun 6 Sunday
Date, Weekday and DayID are what I got from the PIC.
RealDay is using the =TEXT(value,"dddd") function in Excel
What I cant figure out is that this is the SAME PROGRAM with just a small section of code copied into a separate subroutine to generate the dates for this test.
As you can see, 6-OCT-2006 gets generated as "FRI" but when I use the date setting routine in my program I end up with "SUN".
Will investigate further but it look like I was predicting the end of the world prematurely. Apologies to Melanie
Last edited by keithdoxey; - 6th October 2006 at 13:19.
Keith
www.diyha.co.uk
www.kat5.tv
Bookmarks