6 replies
by medievaldude
In this example, I'll use 5/1/2002 as my "from" date and 5/13/2002 as my "to" date
SELECT *
FROM mytable
WHERE [Date] >= '05/01/2002'
AND [Date] <= '05/13/2002'
by medievaldude
This query will include both 5/1/2002 and 5/13/2002 in the final result set. If you want to exclude them, drop both = signs, rendering it like this:
WHERE [Date] > '05/01/2002'
AND [Date] < '05/13/2002'
by lifeline
Thankyou very much.
I am closing this question now.
by shanghai sam
Medievaldude is correct but to avoid issues to do with date formats I use a 3 letter abbreviation for the month e.g.
SELECT *
FROM mytable
WHERE [Date] >= 'May/01/2002'
AND [Date] <= 'May/13/2002'
There can be issues to do with the SQL parser guessing the format of a numerical date with random results
by lifeline
by lifeline
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending