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 |
|
inbs
Aged Yak Warrior
860 Posts |
Posted - 2009-04-12 : 08:16:15
|
| if i have to dates like :5-4-09 and 30-4-09how can i know if 7-4-09 was between the dates? |
|
|
cshah1
Constraint Violating Yak Guru
347 Posts |
Posted - 2009-04-12 : 08:28:27
|
| ??? I am sorry what's your questiono as ther is no DDL butWHERE youdatecolumn >= '5-4-09' AND youdatecolumn < = '30-4-09'or you can use BETWEEN |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-04-12 : 13:21:12
|
| if your both the fields are of datetime just like belowSELECT CASE WHEN @date BETWEEN date1 AND date2 THEN 'Yes' ELSE 'No' END@date is paased value (in your ex 7-4-09) |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-13 : 02:57:39
|
| Also use proper datetime datatype and express dates in YYYYMMDD formatMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|