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

DateTime formula for Cross-Tab Report

Status
Not open for further replies.

R000k

Programmer
Nov 9, 2010
5
GB
Hello,

I am currently using Crystal 9 and I have a cross tab report that is displaying the data like the below:


2008 2009 2010 2011 2012 2013
$5 $10 $10 $20 $50 $50

I need to write a formula that will display the current year going forward so I wrote this formula:

if Year({Table.Date}) >= Year (currentdate) then Year ({Table.Date})

This is the result


0 2010 2011 2012 2013
$15 $10 $20 $50 $50

I need to get rid of the "0" column and I am having a problem writing the ELSE part of the formula.

Any help would be greatly appreciated. Thanks.

 
If you exclude records that are not in the future, the crosstab will correct itself.

If it is part of a larger report, you could create a subreport, placed in the report header or footer and showing just the crosstab. A quick way to do this is to save the report under another name and then import it as a crosstab.

Note that Edit > Subreport Links allows you to pass parameters, when these are relevant.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Go to the customize style tab and check "suppress empty columns" and "suppress empty rows".

-LB
 
Excluding the records using Select Expert worked. That was so simple I can't believe that did not come to me. I guess you learn more and more each day. Thanks you guys!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top