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

Determine the current day when selecting a record

Status
Not open for further replies.

FrontPager

Programmer
Jan 24, 2004
2
US
Hi,

I'm connecting to a table that has the following fields:

DayName (Monday, Tuesday, etc.)
Start (11am, 3pm, etc)
Stop (12pm, 4pm, etc)
Protocol (Instructions specific to that day/time)

Here's my SQL statement:

SELECT * FROM Protocols WHERE Start<=Time() AND Stop>=Time()

That works fine, but I also want to match Dayname to the current day.

For instance, if today is Thursday, I only want to pull the records from the table "Protocols" where Dayname is Thursday, and Start/Stop is within the current time.

How should my SQL look??
 
I am not sure if this will be of much help, but I think you are going to first have to establish what the current day of the week name is - then figure out the SQL statement.

Maybe these pages I found will help get you off in the right direction:


HTH
Tiffany

Microsoft MVP - FrontPage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top