Skip to content
Advertisement

Getting not valid month in Oracle sql

I have a table called Transactions that has a column called trans_date. I am just trying to do a simple query in the SQL*Plus command window

The query is

When I run this query I get not valid month and there is a little * under trans_date. Most of what I have read suggests the query is right but I am not sure what the problem is. The data type is varchar2(20).

Advertisement

Answer

Since trans_date is a varchar and you’re trying to query whether it’s between two dates, you need to convert it to a date too. Assuming it has the same format as the literals in your query:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement