Filter Not Working on date

后端 未结 1 1982
失恋的感觉
失恋的感觉 2021-01-28 04:07

Please help me in applying a filter I am using a query, but it\'s not working in my case

SELECT *
FROM transactionList
WHERE transactionDate >= \'2018-05-29\'         


        
相关标签:
1条回答
  • 2021-01-28 04:36

    It looks like you have the date range backwards. You probably intended to find all records whose transactions took place between 29-April-2018 and 29-May-2018:

    SELECT *
    FROM transactionList
    WHERE transactionDate BETWEEN '2018-04-29' AND '2018-05-29'
    LIMIT 20;
    

    Note that in this case you may use the BETWEEN operator, which is inclusive on both ends, instead of the more verbose way you phrased the date range.

    0 讨论(0)
提交回复
热议问题