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 |
|
khufiamalik
Posting Yak Master
120 Posts |
Posted - 2008-08-26 : 02:18:50
|
| Hello All,I have to compare date in my query and my query is likeselect * from ABCwhere Date1>=(Select DateColumn from Table2 on MyCondition)andDate2<= (Select DateColumn from Table2 on MyCondition)But the above mentioned query is not working properly.Can I Use >= and <= in query? |
|
|
sunil
Constraint Violating Yak Guru
282 Posts |
Posted - 2008-08-26 : 02:34:27
|
| Query posted by you gives error:Msg 156, Level 15, State 1, Line 1Incorrect syntax near the keyword 'on'.Msg 156, Level 15, State 1, Line 1Incorrect syntax near the keyword 'on'.Please provide table structure with sample data and desired output. |
 |
|
|
khufiamalik
Posting Yak Master
120 Posts |
Posted - 2008-08-26 : 02:38:21
|
| Actually this is not exact query , this is structure of query :)I just want to compare a date with in my query and wants to use >= and <= signs,but when i use >= sign , query is executed OK but results are fetched by > sign only and = sign is ignored. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-08-26 : 02:47:58
|
select * from ABCwhere Date1>=(Select DateColumn from Table2 on where MyCondition)andDate2<= (Select DateColumn from Table2 on where MyCondition) E 12°55'05.25"N 56°04'39.16" |
 |
|
|
sunil
Constraint Violating Yak Guru
282 Posts |
|
|
|
|
|