Here is my table having column(completed_on) with datetime
field.
However I need to filter results based on date
only.
x
SELECT * FROM myTable
WHERE completed_on
-- Pass Date Range in condition
Advertisement
Answer
Please tyr this
SELECT * FROM myTable
WHERE completed_on BETWEEN 'date1' and 'Date2'
-- Pass Date Range in condition
Another option is-
SELECT * FROM myTable
WHERE completed_on >= '20190701' --Sample start Date
and completed_on < '20190722'
-- This will make sure dates will be inclued less then
-- the given date. You have to pass this with
-- understanding what you want. If you want
-- date 7 to be included, please set the end date to 8