Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Gyto
Posting Yak Master
144 Posts |
Posted - 2006-09-25 : 06:57:04
|
| HeyI'm having trouble with an SQL statement where I need to include multiple commands, in particular BETWEEN commands.Example:SELECT * FROM dbo.Table WHERE TheDate BETWEEN ("& Date1 &") AND ("& Date2 &").....Then I need to add more statements here, but I'm not sure of the syntax....assuming it's possible?!If not will I have to split it down into multiple SQL statements?Thanks in advance!Matt |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-09-25 : 07:12:52
|
Somthing like this SELECT * FROM dbo.Table WHERE (TheDate BETWEEN ("& Date1 &") AND ("& Date2 &")) And (TheDate1 BETWEEN ("& Date3 &") AND ("& Date4 &")) Chirag |
 |
|
|
Gyto
Posting Yak Master
144 Posts |
Posted - 2006-09-25 : 08:36:18
|
| Great thanks, think I've done it :) |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
|
|
|