Dates and Times

Hi All!!

I have some php script in a program I use and I’m struggling to change it. It works fine Getting the personId for any details less than 1 day old, but I want to change it to any details less than 1 hour old. I’ve tried changing DATEADD(d,-1,getdate()) to DATEADD(h,-1,getdate()) and googling other things but still stumped

Any Ideas?

select
PersonId
dReceievedDate = cast(YEAR(dReceievedDate) as varchar(4))+’-’+ RIGHT(CAST(MONTH(dReceievedDate) as varchar(2)),2)+’-’+ RIGHT(CAST(DAY(dReceievedDate) as varchar(2)),2)
from
peopletbl
where dReceievedDate >DATEADD(d,-1,getdate())
order by PersonId DESC

What data type is the dReceievedDate column?

I’m not sure of the datetype, but this is an example of one of the datetimes.

2013-09-24T19:40:42Z

Sponsor our Newsletter | Privacy Policy | Terms of Service