Working with Calendar Days

G

Guest

Hi,

I have a days table where each calander day is represented from 1 - 7 (where
1=sun, 2=mon, 3=tues, 4=wed, 5=thu, 6=fri, 7=sat)

I need to do the following in SQL:

1) work out the current day (today's calander day)
2) convert current day to a number
3) extract any records stored that represent the current day

Thanks,
GLT
 
A

Allen Browne

Today's date is:
Date()

To get the week-day number:
Weekday(Date())

If you have a field containing a value between 1 to 7, and you want to
select the records that match today's date, just put that last expression
into the Criteria row under this field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

top 5 days for each user 12
Sorting day names chronologically 5
Day of week queries 4
Week Days 5
Schedule Query 5
Listing activities by Week - Revisited 5
The Tueday prior to a holiday... 8
Overflow 2

Top