WeekDay From Given Date

  • Thread starter Thread starter Graham Clements
  • Start date Start date
G

Graham Clements

I have a problem! I'm hoping the solution should be
fairly straight forward as I do not want to over-
complicate things within my database. I require a
function which will give the Week Day (Sun-Sat, or 1-7)
from a given Date (ie 15/01/2005 would result in
Thursday). I am using Access 2000 and would like to use
this as part of a query.

Should any of you require more information let me
know. I thankyou for any help given.

Graham Clements
 
I have a problem! I'm hoping the solution should be
fairly straight forward as I do not want to over-
complicate things within my database. I require a
function which will give the Week Day (Sun-Sat, or 1-7)
from a given Date (ie 15/01/2005 would result in
Thursday). I am using Access 2000 and would like to use
this as part of a query.

Should any of you require more information let me
know. I thankyou for any help given.

Graham Clements

You're there already:

Weekday([datefield])

will give 1 to 7; or

Format([datefield], "ddd") will give Thu; or

Format([datefield], "dddd") will give Thursday.
 
Graham,

The best way I have found to do this is to create a new
column in your
query and use the date part function. The following is an
example I used:

Expr1: DatePart("w",[Start Date])

This will return a numeric value between 1-7 (one being
Sunday and 7 being Saterday)

To use this simple copy my expresion, paste into your next
free column in your query and replace what I called "Start
Date"
with the name of the date column you would like to use in
your query.

This works the best as it allows you to data select on
that column.

Hope this helps

Robert
 
Back
Top