immaduddinahmed
Ten Centuries
Points: 1375
More actions
September 23, 2014 at 2:15 am
#150241
hello,
I want to get created Last Two Week Data in Sql Server.
Is this query Correct.
SELECT ContactId,FirstName,MiddleName,LastName,CreatedOn
FROM Contact
WHERE CreatedOn >= DATEADD(day,-14, GETDATE())
Thanks For The Help.
immad
Koen Verbeeck
SSC Guru
Points: 259115
September 23, 2014 at 2:28 am
#1747327
Depends.
Right now it is for example 10:28AM.
With your query you won't find data before 10:28AM two weeks ago.
Need an answer? No, you need a questionMy blog at https://sqlkover.com.MCSE Business Intelligence - Microsoft Data Platform MVP
Michael_Garrison
Hall of Fame
Points: 3110
September 25, 2014 at 9:49 am
#1748241
try this: select DATEADD(dd,-14,CONVERT(datetime,CONVERT(nvarchar(11),GETDATE())))
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply