Here is my SQL for DB2 AS/400:
----------------------------------------------------
SELECT ARLIB.EDXCTLP.EDATE, ARLIB.EDXCTLP.CTRL#, ARLIB.EDXCTLP.VEND#, ARLIB.EDXCTLP.VNAME, ARLIB.EDXCTLP.ETRANDT, ARLIB.EDXCTLP.ADROP, ARLIB.EDXCTLP.ADC, ARLIB.EDXCTLP.ACPSUB, ARLIB.EDXCTLP.RDROP, ARLIB.EDXCTLP.RDC, ARLIB.EDXCTLP.REJSUB, ARLIB.EDXCTLP.BATTOT, CURDATE()
FROM ARLIB.EDXCTLP
WHERE ETRANDT = CHAR(CURDATE(), mm/dd/yy)
-----------------------------------------------------
My problem is with the WHERE STATEMENT. I'm trying to use the CURDATE() function and the CHAR() function together. What this is essentially doing is taking the CURDATE() function and turning the value into a string. The problem I'm running into is that I need the string in the format mm/dd/yy. CURDATE is putting it in the format mm/dd/yyyy. I only need the two did year. Please help!
----------------------------------------------------
SELECT ARLIB.EDXCTLP.EDATE, ARLIB.EDXCTLP.CTRL#, ARLIB.EDXCTLP.VEND#, ARLIB.EDXCTLP.VNAME, ARLIB.EDXCTLP.ETRANDT, ARLIB.EDXCTLP.ADROP, ARLIB.EDXCTLP.ADC, ARLIB.EDXCTLP.ACPSUB, ARLIB.EDXCTLP.RDROP, ARLIB.EDXCTLP.RDC, ARLIB.EDXCTLP.REJSUB, ARLIB.EDXCTLP.BATTOT, CURDATE()
FROM ARLIB.EDXCTLP
WHERE ETRANDT = CHAR(CURDATE(), mm/dd/yy)
-----------------------------------------------------
My problem is with the WHERE STATEMENT. I'm trying to use the CURDATE() function and the CHAR() function together. What this is essentially doing is taking the CURDATE() function and turning the value into a string. The problem I'm running into is that I need the string in the format mm/dd/yy. CURDATE is putting it in the format mm/dd/yyyy. I only need the two did year. Please help!