5 pts.
 Convert date to match database field with L data type?
The field in file is defined with data type L (2008-09-29). My date range in display file is MMDDYY. How do I convert prompt date so I can opnqryf on field in data base file?

Software/Hardware used:
ASKED: September 29, 2008  2:12 PM
UPDATED: September 30, 2008  4:26 PM

Answer Wiki:
The CVTDAT command should be able to do the job. Within CVTDAT, the DATE parameter would be your display file's MMDDYY field. The TOVAR parameter would be a new 10-character variable that you would define in the CL. FROMFMT would be *MDY, TOFMT would be *ISO, and TOSEP would be a dash ('-'). I presume you are using a character variable for the QRYSLT parameter of the OPNQRYF command. Within that command, you should have a double-quote character both before and after the 10-character date variable used in the CVTDAT command.
Last Wiki Answer Submitted:  September 30, 2008  4:26 pm  by  LJansen   85 pts.
All Answer Wiki Contributors:  LJansen   85 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _