Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Its Starange!!

Author  Topic 

satheesh
Posting Yak Master

152 Posts

Posted - 2011-03-24 : 08:33:08
Hi All

Follow up to my previous post, i am trying to pull last 24 hrs data
i got some starnge result for a query.

Any Idea,

cst.DateCreated from cst WHERE cst.DateCreated > dateadd(hh,-9,getdate())

it pulls data around this time yesterday to the time execution now (24hrs) !!

How?

Regards,
SG

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-03-24 : 08:56:05
What is the data type for DateCreated and can you provide a sample value for it that is giving you the strange results?

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

satheesh
Posting Yak Master

152 Posts

Posted - 2011-03-24 : 09:09:48
Thanks for you reply Jimf

Data type for 'datecreated' -datetime

Result -> reterived data from - 2011-03-23 12:42:30.740 to the time of execution.I executed the query at 24.03.2011 13.08

How its possible for this
cst.DateCreated from cst WHERE cst.DateCreated > dateadd(hh,-9,getdate())

Regards,
GS
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-03-24 : 10:01:45
could you also give an example from DateCreated that was returned in your query that shouldn't have been. This is a strange problem and I'm wondering if what you think is in DateCreated is actually what's in there. It's been my experience that data dives sometimes turn in to dumpster dives.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -