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

Date(dd/mm/yyyy) - monthly frequency (01/03/06/12/etc.) 2

Status
Not open for further replies.

luzippu

Programmer
Sep 2, 2003
24
GB
How would you subtruct a frequency 3 (where 3 is a quarterly frequency) from a date (dd/mm/yyyy)?

ie: {billing.date}-{billing.frequency}:
01/06/2003 - 3 = 01/03/2003 or
01/05/2003 - 6 = 01/11/2002 or
01/12/2002 - 12 = 01/12/2001 etc.

Thank you
 
For Crystal 8.5, a command like
DateAdd ("m", -3, {billing.date})

would get you a date three months ago. The comlpication in your case is the variable, {billing.frequency}. I don't think the command would accept a variable, though it might. Otherwise you'd need a series of tests,
if {billing.date} = 3
then DateAdd ("m", -3, {billing.date})
etc.

Madawc Williams
East Anglia, Great Britain
 
Madawc has the function, but I think that you'd want:

DateAdd ("m", -{billing.frequency}, {billing.date})

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top