View Full Version : Show day of the week


dwilliams
06-06-2008, 05:18 PM
Hi,
I have a straight forward table with a field called DATE. I run a query on that table so that I can create a Report selecting data between 2 dates.

What I want to do now is to create a new field in the query that displays the actual day of the week (Monday, Tuesday etc). I have tried mucking about with the Weekday function but cannot get it work.

Any help would be appreciated

Thank you

David

PS - OK I found a way using WeekdayName(Weekday([Date])). However the problem now is that it appears to be one day out. eg 30/05/08 shows Saturday when it should be Friday

boblarson
06-06-2008, 05:45 PM
Why not just:

Format([YourDateField],"dddd")

raskew
06-06-2008, 08:11 PM
Hi -

Need to rename your field. Date is an Access reserved word (name of a built-in function), e.g.

? date
6/6/2008

Re Bob L.'s solution:

? Format(#5/30/08#,"dddd")
Friday
? Format(#30-May-08#,"dddd")
Friday
? Format(#5/30/09#,"dddd")
Saturday

Works great. Check your input.

Bob A.

dwilliams
06-09-2008, 03:29 PM
Why not just:

Format([YourDateField],"dddd")

Thanks for your reply but where do I put this - in the table design or in the query?
Cheers
Dave

Mike375
06-09-2008, 03:51 PM
In a new calculated field in your query

NewFieldName: WeekdayName(Weekday([DateFiledName]))

boblarson
06-09-2008, 04:49 PM
Or:

NewFieldName:Format([YourDateField],"dddd")

boblarson
06-09-2008, 04:50 PM
In a new calculated field in your query

NewFieldName: WeekdayName(Weekday([DateFiledName]))

Why use two functions when one will do???? :confused:

Mike375
06-09-2008, 04:59 PM
Why use two functions when one will do???? :confused:

Because that is all I knew:D

boblarson
06-09-2008, 05:06 PM
Because that is all I knew:D

But that post was AFTER I had already posted the single function. That's why I was wondering. I guess you might have just skipped over that post of mine and didn't see it.

Mike375
06-09-2008, 05:24 PM
Bob,

I just updated:)

Rich
06-10-2008, 12:08 AM
You don't need to do anything in the query, just add an unbound textbox to the Report, set its control source to =[YourDateField], set the display format to "dddd" .