Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 13, 2012 11:43 AM by sairam62.cse
Member
135 Points
173 Posts
Apr 13, 2012 11:39 AM|LINK
hi dear ,
I want fetch many record from 3 month ago to today.how can fetch them
How can I check whether this value is older than 3 months ago using a SQL query?
my code is:
select * from orders r where r.dateInsert < DATEADD(month, -3, GETDATE()
is my script true?
All-Star
34391 Points
5529 Posts
Apr 13, 2012 11:42 AM|LINK
nazlin hi dear , I want fetch many record from 3 month ago to today.how can fetch them How can I check whether this value is older than 3 months ago using a SQL query? my code is: select * from orders r where r.dateInsert < DATEADD(month, -3, GETDATE() is my script true?
if you want to get data from last 3 month to today... then u r query need little change
as this
select * from orders r where r.dateInsert > DATEADD(month, -3, GETDATE())
it should be greater than comarison operator
hope this helps...
Participant
993 Points
311 Posts
Apr 13, 2012 11:43 AM|LINK
select * from orders r where r.dateInsert > DATEADD(month, -3, GETDATE()
nazlin
Member
135 Points
173 Posts
fetch data from 3month ago to today
Apr 13, 2012 11:39 AM|LINK
hi dear ,
I want fetch many record from 3 month ago to today.how can fetch them
How can I check whether this value is older than 3 months ago using a SQL query?
my code is:
select * from orders r where r.dateInsert < DATEADD(month, -3, GETDATE()
is my script true?
kedarrkulkar...
All-Star
34391 Points
5529 Posts
Re: fetch data from 3month ago to today
Apr 13, 2012 11:42 AM|LINK
if you want to get data from last 3 month to today... then u r query need little change
as this
select * from orders r where r.dateInsert > DATEADD(month, -3, GETDATE())
it should be greater than comarison operator
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
sairam62.cse
Participant
993 Points
311 Posts
Re: fetch data from 3month ago to today
Apr 13, 2012 11:43 AM|LINK
select * from orders r where r.dateInsert > DATEADD(month, -3, GETDATE()
s.sairam