PDA

View Full Version : Validate ISO date in /Free?



Guest.Visitor
11-03-2003, 10:29 PM
The test opcode is supported in /free Test(de) *mdy Testdate; If %error; ...

Guest.Visitor
11-04-2003, 05:35 AM
The date format you posted is *USA, not *MDY. Do this: Monitor; wtDate = %DATE(TDATE:*USA); On-Error; // do something - invalid *USA date EndMon; Chris

mstrozier@hmstn.com
11-04-2003, 07:34 AM
I am trying to validate the date before converting into ISO format. The code I am using to put into ISO is below: wtDate = %DATE(TDATE:*MDY); Where wtDate is my ISO date field inz in the D specs, Tdate is my incoming date. Let's say Tdate = 11032003. This works just fine. Converts the date to -2003-11-03' However lets say the incoming date is 11332003. Ofcourse once this piece of code is ran I will get a date timestamp error. The old method I used was: C *mdy Test(D) Testdate where testdate would be the 6 digit version of the date. And if %found it would then proceed to error out to an report and default date to '0001-01-01' Thanks for any suggestions if this is possible in /free

mstrozier@hmstn.com
11-04-2003, 07:34 AM
Thanks, that works :)