Skip to content
Advertisement

How can I change the grammar in mysql?

in my query

result

However, if you search after changing the trdDtTm format, the results will not come out. How do I fix it?

no items.. how to fix it?

Advertisement

Answer

trdDtTm is a datetime column.

compares a datetime with a number hence. This makes hardly sense. Maybe you hope for the DBMS to magically match the two, but you shouldn’t. Compare with a date literal instead:

And if you want to find all rows on that date regardless of the time (the above only finds midnight, as DATE '2022-02-03' is considered equal to TIMESTAMP '2022-02-03 00:00:00'), do:

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