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!

Need different dollar amount recorded if before a specific date

Status
Not open for further replies.

dkaf

Technical User
Mar 29, 2005
15
US
I am using Crystal Reports 10. I have a vehicle insurance report I am writing. Each year the insurance figure changes. I want to write the report so if the date is before Jan 1 2006 the insurance figure is 105.00. If it is after Jan 1 2006 it is the figure defined in the field.

My field is Fixed_insurance_cost. There is no date linked to the insurance so I've used fueling dates to define my dates.

Next year I will have to add to the formula to make the date befor Jan 1 2007 the figure is 145.00 and if it is after Jan 1 2007 it will be the figure defined in the field
 
Create a formula field that chooses an amount based on the date, e.g.
Code:
if {your.date} < Date(2006, 01, 010
then 105
else 145
I'm assuming that 1st Jan is at the higher rate - you say before and after and don't specify 'On'.

The formula field can then be used in calculations.

[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