I want to select varchar within date. I already tried code below but it will ignore date selection. It will select outside(and inside) the date range.
SELECT *
FROM register
WHERE company LIKE '%abc%' OR address LIKE '%def%'
AND Timestamp
BETWEEN '2011-8-1 10:00:00'
AND '2011-8-31 10:00:00'
If I just leave the date itself, yes it works
SELECT *
FROM register
WHERE Timestamp
BETWEEN '2011-8-1 10:00:00'
AND '2011-8-31 10:00:00'
I just want select varchar WITHIN selected date. How?
That’s because of operators
ORandANDprecendence.Wrap your whole
ORpart with parenthesis