Hi all,
I've the following formula which compares two date fields:
' Evalulate Forecast & Actual Dates
dim DateForecast as date
dim DateActual as date
dim Result as string
' Comparision
DateActual = DateValue({dtblDMC2163Options.D_MSV_A})
DateForecast = DateValue({dtblDMC2163Options.D_MSV_F})
if DateActual = dateserial(1901,12,31) then Result = "N/A"
if DateActual < dateserial(1990,01,01) and DateForecast = dateserial(1901,12,31) then Result = "N/A"
if DateActual > dateserial(1990,01,01) then Result = cstr(DateActual)
if DateActual < dateserial(1990,01,01) and DateForecast > dateserial(1990,01,01) then Result = cstr(DateForecast)
Result = cstr(DateForecast)
' Result
formula = Result
Basically it all works ok, except that the 'DateForcast' value is not shown. I've commented out all lines of code except 'formula = DateForecast' and this does output the value, however as soon as I uncomment 'DateActual = DateActual = DateValue({dtblDMC2163Options.D_MSV_A})' the Forecast Date doesn't show up.
Any idea why this may be? The formula says there's no Errors.
I've the following formula which compares two date fields:
' Evalulate Forecast & Actual Dates
dim DateForecast as date
dim DateActual as date
dim Result as string
' Comparision
DateActual = DateValue({dtblDMC2163Options.D_MSV_A})
DateForecast = DateValue({dtblDMC2163Options.D_MSV_F})
if DateActual = dateserial(1901,12,31) then Result = "N/A"
if DateActual < dateserial(1990,01,01) and DateForecast = dateserial(1901,12,31) then Result = "N/A"
if DateActual > dateserial(1990,01,01) then Result = cstr(DateActual)
if DateActual < dateserial(1990,01,01) and DateForecast > dateserial(1990,01,01) then Result = cstr(DateForecast)
Result = cstr(DateForecast)
' Result
formula = Result
Basically it all works ok, except that the 'DateForcast' value is not shown. I've commented out all lines of code except 'formula = DateForecast' and this does output the value, however as soon as I uncomment 'DateActual = DateActual = DateValue({dtblDMC2163Options.D_MSV_A})' the Forecast Date doesn't show up.
Any idea why this may be? The formula says there's no Errors.