Day Name from Date (1 Viewer)

fat controller

Slightly round the bend..
Local time
Today, 10:36
Joined
Apr 14, 2011
Messages
758
I have a report on which I have two unbound text boxes that I want to populate with the dayname for a related date. One is called txtStartDateName, and the other...... yep, you guessed it, its txtEndDateName

txtStartDate name Control Source is:

Code:
=WeekdayName(Weekday([txtStartDate]))

With very similar for txtEndDate

Now, the odd thing is that when I run the report, the day names that appear in these boxes are the day before the actual date - - - so if I used today's date (26/03/2015), I would get Wednesday instead of Thursday as it actually is?

At first I thought it was my PC at work screwing around, but I have now tried a copy of the database on my new PC at home and it is exactly the same?

Any idea what I am doing wrong?
 
Why not using the format function for that?

Code:
Format([txtStartDate], "dddd")
 
Seems there's a day of week setting somewhere. Sometimes sun = 1 and sometimes its set to 7, etc. You could patch by subtracting 1 from the weekday - ?
 
you need to specify the firstdayofweek, try

=WeekdayName(Weekday([txtStartDate],0))

Or 2 to force the Monday

don't ask me why, but the default for weekday is 1 (Sunday) but for weekdayname it is 0 (system)
 
Thank you all :) - - I am well and truly spoiled for choice for a solution, as all three work perfectly :)
 

Users who are viewing this thread

Back
Top Bottom