What's wrong of the date format?
Dear Sir/Madam
I am coding an application by VB6 (XP Pro) with database oracle 11g (centOS 5).
As before, I was always using TO_DATE method to change a string to be date as following.
select sum(invoice_total) from invoice
where invoice_date between TO_DATE('01-07-2008','DD-MM-YYYY') and ADD_MONTHS(TO_DATE('01-07-2008','DD-MM-YYYY'), 1) -1
But, now I would like to simplify the query string to be following
select sum(invoice_total) from invoice
where invoice_date between '01/07/2008' and ADD_MONTHS('01/07/2008', 1) -1
But, it is don't work with an error 'ORA-01843:'
Is anyone can let me know what's the problem/error of above statement and how to solve it with simplified statement?
Thanks
Francis SZE