1

I am using the following query to select logs fro a logs table.

SELECT * FROM LOGS  WHERE LOG_DATE BETWEEN TO_TIMESTAMP(:date_start, 'MM-DD-YYYY') AND TO_TIMESTAMP(:date_end, 'MM-DD-YYYY')

I have the following dictionary of parameters:

{'date_start': '02-24-20', 'date_end': '02-24-20'}

and executing the query as follows :

cursor.execute(query, params)

Now the problem is I am not getting any values for this date range. But if I execute the query in Oracle, by specifying the dates, it is working. What is wrong here ?

1 Answer 1

3

If you specified format mask as 'MM-DD-YYYY', why do you then provide only two digits for year ('02-24-20')? Provide 4 digits.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.