Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 15521

SQLite Date Range Not Recognized

$
0
0

I have a SQLite database table that contains a column for date. The date column has values that span across 2023 and 2024. The table has entries for November 2023 and May 2024.When I execute the following sql

SELECT trans.date as 'transdate' FROM 'Transaction' trans WHERE transdate >= '01-01-2024' AND transdate <= '05-21-2024'

I get the values for May as I expect. When I execute SQL using the previous year

SELECT trans.date as 'transdate' FROM 'Transaction' trans WHERE transdate >= '11-01-2023' AND transdate <= '05-21-2024'

I get nothing. It won't recognize the previous year.

I understand "date" is a keyword. But that doesn't seem to matter because the query works when I use only this year's value. (2024)


Viewing all articles
Browse latest Browse all 15521

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>