help with date formula
Hello.
Please help. Assistance is needed and appreciated.
I have a date formula which displays a date string from a table column called ContractDate in this format 010305 - which is March 2005 for example. My formula is as follows:
@contract
Local StringVar message := "";
If {ContractDate} = "000000" Then
(
message := "Returning to Contract";
)
else CStr(CDateTime({ContractDate), "MM""/""yyyy")
If the ContractDate has a "0000" value, a message is displayed "Returning to Contract". Thats fine.
My problem is that if the date is not a correct date e.g. I have a value 011612, Crystal reports outputs the date as 12/-4714, which is totally wrong. So what do I do to check whether the date is a valid date or not. Is there a conditional formula i could write to check this and then if an invalid date shows up i could write an appropriate message, otherwise display the date?
Please help. I am using CR10. Thanks.
|