I have stored my date and time in database in following format and as TEXT.
MM/dd/yyyy HH:mm:ss
I am trying to select all records ONLY from yesterday by doing this:
SELECT * from source_tbl where date_time = (select max(date_time)
from source_tbl
WHERE date_time < DATE('now', '-1 day') )
I know that if I only store MM/dd/yyyy in database, then my above query will work fine, but in my situation I have HH:mm:ss so it is not going to work.
But is there any way to get only MM/dd/yyyy portion and then apply my above query, or any way of doing this?