I have a site with a SELECT statement like this:
SELECT * FROM MyTable WHERE MyDate >= GETDATE()
I have a record with the value 6/24/2009 9:00:00 AM to MyDate field.
When the user visit this page in 6/24/2009 before 9:00:00 AM, this record is shown. But when the user visit this page in 6/24/2009, but after 9:00:00 AM, the SELECT don’t get this record.
How can I build this SELECT statement disconsidering time, to this record appers until 6/24/2009 12:00:00 PM?
Thank you.
Do you really mean 12:00 PM? That’s noon, not midnight. Sounds like you really want somthing more like this:
See this:
How can I truncate a datetime in SQL Server?
The