Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Day of week given the date

Status
Not open for further replies.

LeeEck

Technical User
Mar 25, 2001
3
GB
Hi
Im trying to find a way of for a large set of dates in a table, some way of giving the day of the week for each given date because later I will need to run queries that work off the day of the Week so for example for all the dates that are a thursday a certain query can be run just on the days that are thursday and so on for all the days of the week.

Any help would be much appreciated
Cheers
 
I believe the Weekday built-in function should do the trick. Given a date, it returns an integer from 1 to 7 based on the day of week. Therefore, to return only those records for Thursday from a date field named MyDate, I would create a calculated field within a query defined as:

MyDateDayOfWeek: Weekday([MyDate])

To then only grab the records from Thursday, set the criteria for this field to:

=5

I hope that helps!
 
Thanks for the reply,
I have just found the a slightly different answer on someone elses previously asked question which said to do this:

ShowOnDay:Format([Date],"dddd")

Where the date is a list of the days that I need to run the query on and this works giving me the day for every date.

I will keep note of your help because it may come in very useful later on in the development of my database.

Cheers
Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top