In my query I need to include all the records for a Person that fall between today and two weeks back. The table I am selecting records from has just one date field - PeriodStartDate
------ "There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
Depends on definition of "two weeks back". Does it mean:
a) 14 days back, time value included
b) 14 days back, time value excluded (from 00:00AM)
c) during last two days (starting with Sunday or Monday, depending on language settings)
?
------ "There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
It is SQL server. Two weeks would be 14 days back from the time the query is run.
Basically this is a sproc that is used to create a Crystal report. The Sproc needs to pull records of employees whose PeriodStartdate falls with the two weeks of the date the report is run
...
where PeriodStartDate >= dateadd(wk, -2, getdate()) and PeriodStartDate <= getDate()
------ "There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.