All Forums General
teradata006 8 posts Joined 03/12
29 Mar 2012
SQl for current period and Previous period

 

Is there any SQL that contains the current period which should be current month begin date and current month end date and similarly for the previous period which should be previous month begin date and previous month end date

Ex: Current Period :(03/01/2012-03/31/2012)

Previous Period :(02/01/2012-02/29/2012)

This is what I am trying to look for.I already have SQL's for current month begin and end dates also for previous month begin and end dates.

But, I am looking for something which is mentioned on the top.Is it possible to get SQL like this?

 

Adeel Chaudhry 773 posts Joined 04/08
02 Apr 2012

Hi,

 

You can use calenders to get the min and max from within a month.

 

Regards, Adeel

 

-- If you are stuck at something .... consider it an opportunity to think anew.

You must sign in to leave a comment.