This content has been marked as final. Show 10 replies
1. performing all your calculations (assuming they are on these "date" strings)
2. obtaining the date + time as strings
3. using TO_DATE to convert these strings to dates, and then
4. storing these dates in your table ?
That way, you will be able to let Oracle handle all date arithmetic on dates.
The string value which is stored in the database is in this format '8/30/2007 1:26:56 PM'
The format Mask is 'mm/dd/yyyy HH:MI:SS AM'
The query which I am using is:
SELECT billed_time FROM bill WHERE billed_time >= to_DATE('01/01/2007 12:00:01 AM','mm/dd/yyyy HH:MI:SS AM')
I am getting not a valid month error when trying to run this query.
Message was edited by:
you need to convert the column into date format too!
The issue you're seeing is because the billed_time column is being implicitly converted to a date, based on what your NLS settings are. You should always explicitly convert strings to dates (even the greatest of experts can get caught out by not doing this!)
SELECT billed_time FROM bill WHERE TO_DATE(billed_time, 'mm/dd/yyyy HH:MI:SS AM') >= TO_DATE('01/01/2007 12:00:01 AM','mm/dd/yyyy HH:MI:SS AM');