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!

SELECT WHERE Statement on Timestamp Field 1

Status
Not open for further replies.

AdmanOK

MIS
Mar 5, 2001
412
I have a table that stores calendar events with timestamp field for the start time and end time. I am trying to write an ASP page that displays these fields, however I am not sure how to go about this. I tried something like:

SELECT * FROM events WHERE eventstarttime LIKE '20050816%'

to get all the events for 8/16/2005 but this did not display any records, even though there are events in the calendar for that date.

What would be the correct syntax for this query?
 
Thanks for the quick reply Rudy. I figured that was the answer, I just didn't want to have to calculate the date for the following day to include as an upper limit in the SQL query.
 
do take the time to write the expression for the next day, because that form of the query will allow the optimizer to utilize an index on the timestamp column -- other sql constructions may not

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top