January 28, 2005 at 8:32 am
I have a table with a ModDate column - DBDate datetime (8). I'd like to quickly list the records that were updated on a given date. e.g. on 1/28/2005.
Does anyone have a script that they use to do this?
Thanks
January 28, 2005 at 9:48 am
select * from table
where DBDate between '01/28/2005' and '01/29/2005'
You just have to remember that '01/28/2005' really means '01/28/2005 00:00:00.000' when compared to a datetime.
Greg
Greg
January 28, 2005 at 10:08 am
Thanks Greg. I tried that, but it doesn't work.
select * from table
where DBDate between '01/28/2005' and '01/29/2005'
Doesn't return any records.
If I change it to:
select * from table
where DBDate between '01/27/2005' and '01/29/2005'
I only get records for 1/27/2005.
January 28, 2005 at 11:47 am
Looks like it's working to me. Maybe there aren't any rows with a DBDate of 1/28/2005.
Try the select where DBDate > '01/27/2005' and see what you get.
Greg
Greg
January 28, 2005 at 11:57 am
My bad. You're right, the first script is best. My test db was restored from last night's backup after today's updates were applied.
Thanks
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply