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

Date in future formula

Status
Not open for further replies.

HezMac

Programmer
Jan 14, 2004
56
CA
Hi

I'm creating a report that lists payments for a fiscal year (April 1 - March 31).

I have a column for each month. I'm not using a cross tab query, as the report will be exported into an excel spreadsheet.

The user inputs start and end date parameters. Say the user enters the date range: April 1, 2005 - Sept 30, 2005.

I'd like the values in October, November, December, January, February and March to all be '-' (a dash) instead of zero. But, the values during the date range that are zero to still be zero.

Not sure how to compare the month of current year, or parameter year to create formulas for each month payment.

Any suggestions?

Thanks in advance.
 
Assuming you have some data for those months, you could display as follows:
Code:
if @your.tot > 0 then ToText(@your.tot)
else 
if month({data.date}) > month(currentdate)
then "-"
else "0"




[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Awesome, thanks. That seems to work great.

One more question: the dash is showing, but for some reason, there's a '$' in front of it. I don't have $ set up for any other values... wonder what's going on.

Thanks very much.
 
Oh no....

just realized that fiscal year is going to screw up the month(currentdate) part of the formula....
 
For fiscal year, you can define dates as Date(2005, 10, 19) for today, say. Does that help?

I don't understand about the $. Maybe the field is within a Text Object that has the character in front fo the field.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top