Question
sql dateadd question
In my cfquery, I need to find all records that are
greater than one day old, so I use :
where datediff(d, date_arrived, getdate()) > 1
But this does not work, since I have a date arrived
record of 5/17/2008 and getdate is 5/18/2008, so
datediff should be 1 and the record should not show up on the report
but it does.
I also tried WHERE date_arrived >= #CreateODBCDate( DateAdd("d",-1,Now( )))# but this does not work either.
What am I doing wrong, or what is the proper way to do
this ?
greater than one day old, so I use :
where datediff(d, date_arrived, getdate()) > 1
But this does not work, since I have a date arrived
record of 5/17/2008 and getdate is 5/18/2008, so
datediff should be 1 and the record should not show up on the report
but it does.
I also tried WHERE date_arrived >= #CreateODBCDate( DateAdd("d",-1,Now( )))# but this does not work either.
What am I doing wrong, or what is the proper way to do
this ?
