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 |
|
sent_sara
Constraint Violating Yak Guru
377 Posts |
Posted - 2008-10-03 : 02:28:49
|
| i need to select daterange between '01 apr 2008' and '30 jun 2008'by this all 3 record should come.can any one help how to solveTable:Testitem amt period_from period_to'AA' 11.00 20080401 30042008'fd' 12.00 20080501 31052008'ff' 450.00 20080601 30062008Tried so far,select * from testwhere ('01 apr 2008' between period_from and period_to) and('01 jun 2008' between period_from and period_to) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-03 : 02:33:55
|
| SELECT *FROm tableWHERE period_from >=@startAND period_from <=@end |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-10-03 : 02:53:38
|
change the variablesSELECT *FROm tableWHERE period_from <= @endAND period_to >= @Start E 12°55'05.63"N 56°04'39.26" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-03 : 03:11:02
|
quote: Originally posted by Peso change the variablesSELECT *FROm tableWHERE period_from <= @endAND period_to >= @Start E 12°55'05.63"N 56°04'39.26"
copy paste error |
 |
|
|
sent_sara
Constraint Violating Yak Guru
377 Posts |
Posted - 2008-10-03 : 05:34:53
|
Txs peso and visakh16quote: Originally posted by visakh16
quote: Originally posted by Peso change the variablesSELECT *FROm tableWHERE period_from <= @endAND period_to >= @Start E 12°55'05.63"N 56°04'39.26"
copy paste error
|
 |
|
|
|
|
|