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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query weekends

Status
Not open for further replies.

ashaikh05

MIS
Mar 2, 2007
13
GB
Hello

I have a table which contains a date column dd/mm/yy.

How do I query the table so that only weekends (saturdays and sundays) are displayed and then i would like to create a report with that data.

Many thanks
 
something like:

Code:
SELECT Table5.mydate
FROM Table5
WHERE (((Weekday([mydate]))=1 Or (Weekday([mydate]))=7));

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Something like:
Code:
WHERE (((Weekday([YourTable]![DateField]))=1 Or (Weekday([YourTable]![DateField]))=7));
Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Beat me to it! [smile]

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
And a shorter way:
WHERE Weekday([date field]) In (1, 7)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top