Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello community,
I need to get the result of a query; Date today.
The date field format is 063016. here's my query :
SELECT ....
FROM
WHERE
tt.STARTOFCHARGINGDATE = TO_DATE (TO_CHAR (SYSDATE , 'MMDDYY'), 'MMDDYY')
It didn't work; Error : OraOLEDB, ErrorMsg: ORA-01861: literal does not match format string
Any idea please?
Thanks
STARTOFCHARGINGDATE is a varchar, i.e. text. Your comparing a text value with a date value. Perhaps this works:
SELECT ....
FROM
WHERE
tt.STARTOFCHARGINGDATE = TO_CHAR (SYSDATE , 'MMDDYY')
for your info, the data type of the stratofcharging field is varchar. see bellow :
Thanks in advance.
STARTOFCHARGINGDATE is a varchar, i.e. text. Your comparing a text value with a date value. Perhaps this works:
SELECT ....
FROM
WHERE
tt.STARTOFCHARGINGDATE = TO_CHAR (SYSDATE , 'MMDDYY')
TO_DATE() converts your string to a date.
Since the data type of STARTOFCHARGINGDATE is VARCHAR2, using function TO_CHAR should do it:
WHERE STARTOFCHARGINGDATE = TO_CHAR(SYSDATE, 'MMDDYY')
Best regards,
Erik