We are experiencing network problems with the site. Some functions may be temporarily unavailable. Please bear with us while we work to resolve these issues.
All Forums Enterprise
Sandi 12 posts Joined 10/05
01 Nov 2005
Data retrieval query

Hi all,

I want to retrieve last 3 months data from a table,in which datas are loading daily. I have a query but it is retrieving last 3months data + data loaded till current day.But I need only last 3 months data. For example if i am running that job on oct 5 it should retrieve july,august,Sep data. But my SQLquery is retrieving these 3 months data + Oct1,2,3,4 datas also. Please help me to resolve this problem.

Thanks
------------------------------------------------------ --------------------------

GreatSushant 12 posts Joined 05/05
08 Mar 2006

To add more on this

select current_date;
03/08/2006

select extract(day from date-1);
7

select current_date-extract(day from date-1 );
03/01/2006

select current_date-extract(day from date);
02/28/2006

I think the last query will give you the correct results

You must sign in to leave a comment.