Click to See Complete Forum and Search --> : SQL Question


Esmo2000
February 10th, 2005, 09:47 AM
I have a quick question about SQL but I didn't see a SQL forum so I put it here.

I found this line in a piece of code that I was editing and I was wondering if anyone knew the significance of the #:

and (dateadd(day, (a.date_entered - 693596), '1900-01-01 00:00:00.000') > DATEADD(day, -1, getdate()))

The purpose of the line is to retrieve only day old entries.

Thanks a lot!!

Jim

Krzemo
February 10th, 2005, 10:45 AM
What datetype has a column "a.date_entered" ?

Provide some samples of data...

I was wondering if anyone knew the significance of the #:
I'm geussing that a.date_entered is some kind of number, so "a.date_entered - 693596" gives U a number of days since '1900-01-01 00:00:00.000'.
Now, when U add that to the date '1900-01-01 00:00:00.000' U will get actual datetime value. Now U compare it to day before current "DATEADD(day, -1, getdate())"

Thats all.