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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppressing Quarters if not completed

Status
Not open for further replies.

geestrong

Programmer
Jun 24, 2005
58
US
Hello

I am using Crystal Reports XI and Oracle 9i database.

I have created a report that is grouped by quarter. I am using two parameters(StartDate and EndDate). My Team Lead wants the report to suppress the quarter (i.e. 3rd Quarter) because it does not end until 9/30. I will place the formula in the Select Expert. I have tried several formulas but it has not work. Is there a way to suppress the data if the quarter is not completed.

If {?EndDate} > DateValue (03/31/Year ({?EndDate}))Then
1
else if
{?EndDate} > DateValue (06/30/Year ({?EndDate}))
then
2
else if
{?EndDate} > DateValue (09/30/Year ({?EndDate}))
then
3
else if
{?EndDate} > DateValue (12/31/Year ({?EndDate}))
then
4

Is there a way to suppress the data if the quarter is not completed.

Thanks
Geestrong
 
Alter the record selection to resolve this:

if month({?enddate}) in 1 to 3 then
{table.date} <= cdate(year({?enddate})-1,12,31)
else
if month({?enddate}) in 4 to 6 then
{table.date} <= cdate(year({?enddate}),3,31)
else
if month({?enddate}) in 7 to 9 then
{table.date} <= cdate(year({?enddate}),6,30)
else
if month({?enddate}) in 10 to 12 then
{table.date} <= cdate(year({?enddate}),9,30)

Now you only get rows in the report that are valid.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top