I am getting a 6 digit integer as my input. I have to check if the input integer is a valid date in format MMDDYY. Here is what I do:
I format the integer to get a character in the format MM/DD/YY and then use IConv on this to convert it to internal date.
Code: Select all
Arg = Substrings(Arg1,1,2):'/':Substrings(Arg1,3,2):'/':Substrings(Arg1,5,2)
Ans = Iconv(Arg, "D/MDY[2,2,2]")
043102 - Since in April there are only 30 days it should report an error
023001 - Since in February only 28 days are present it should report an error
Its not working. Is there any better way of validating the date.
Regards,
Sumit