I'm writing a web page to do some scheduling, I have a table
Table1
id
user
beg_date
end_date
The user specifies a begin date and end date to schedule, I do two queries like the following for each date specified....
SELECT * Table1
WHERE (CONVERT(datetime, userspecified date) BETWEEN beg_date AND end_date)
To make sure the date doesn't clash with one all ready scheduled, if it doesn't, I inser the record....
This works great except for one thing.
If March 16-18 is scheduled, and a user specifies March 13-20, it will not flag it as allready scheduled, and schedule over it.
I need to tweak my query. Is their someway to do it so it checks it by range?
Table1
id
user
beg_date
end_date
The user specifies a begin date and end date to schedule, I do two queries like the following for each date specified....
SELECT * Table1
WHERE (CONVERT(datetime, userspecified date) BETWEEN beg_date AND end_date)
To make sure the date doesn't clash with one all ready scheduled, if it doesn't, I inser the record....
This works great except for one thing.
If March 16-18 is scheduled, and a user specifies March 13-20, it will not flag it as allready scheduled, and schedule over it.
I need to tweak my query. Is their someway to do it so it checks it by range?