Hey all;
I have a formula set up that checks if a date from the database is between a certain range - IE between 1st April 2007 and 31st March 2008.
However, at the end of that period - 31st March 2008, I'll need to change this range to 1st April 2008 - 31st March 2009. This formula is repeated for several entries.
I'm fairly new to Crystal, so I was just wondering if there was any way I could declare and populate just two strings in one place, and then refer to these strings in the rest of the formulas, eg:
vb Code:
Public StringFrom as string Public StringTo as string StringFrom = "01/04/2007" StringTo = "31/03/2008" ' If Date of CP12 falls after 1st of April 2007 if DateDiff("y", StringFrom, {data.cp12 date}) > 0 then ' If Date of CP12 falls before 31st March 2008 if datediff("y", StringTo, {data.cp12 date}) < 0 then ' tally it up formula = 1 else end if else formula = 0 end if
I've tried that, but Crystal says that "a date is required here".
Help?![]()




Reply With Quote