Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Formula

Status
Not open for further replies.

slickp

Technical User
Feb 15, 2006
35
GB
Crystal 10

I have a report which needs to be scheduled to run on a server every quarter, so i need to get rid of all the parameter fields so that it can run. One of the parameters is a notified date field. Now this should be the period of the quarter, i.e. 1st quarter 1 Jan 07 to 1 April 07. This report will run on the 2nd Jan, 2nd Apr, 2nd Jul and the 2nd Oct each year. So i need a formula which will take the current date and formulate the period of the quarter for me.

Help please?
 
Try something like:

select quarter(currentdate)
case 1 : {table.date} in date(year(currentdate)-1,10,1) to date(year(currentdate)-1,12,31)
case 2 : {table.date} in Calendar1stQtr
case 3 : {table.date} in Calendar2ndQtr
case 4 : {table.date} in Calendar3rdQtr

This assumes you are using conventional dates for your quarters.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top