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 |
sqldev6363
Yak Posting Veteran
54 Posts |
Posted - 2011-08-10 : 21:26:29
|
select a.id, a.fromDate,b.toDate from AA a Left Outer Join BB b ON a.id = b.idAND (DateDiff(hh,a.fromDate,b.toDate) between 0 and 4)IS the above statement is true or need to change anything?i am getting this error "getting incorrect syntax near the keyword BETWEEN"Thanks in advancedev |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-08-10 : 21:46:15
|
i don't see any problem with that query. Can you post the complete error message ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
sqldev6363
Yak Posting Veteran
54 Posts |
Posted - 2011-08-10 : 21:49:00
|
Here it is Msg 156, Level 15, State 1, Line 1Incorrect syntax near the keyword 'between'.quote: Originally posted by khtan i don't see any problem with that query. Can you post the complete error message ? KH[spoiler]Time is always against us[/spoiler]
dev |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-08-10 : 21:51:24
|
That is the actual query you execute that gives the error message ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
sqldev6363
Yak Posting Veteran
54 Posts |
Posted - 2011-08-10 : 23:22:56
|
YESquote: Originally posted by khtan That is the actual query you execute that gives the error message ? KH[spoiler]Time is always against us[/spoiler]
dev |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-08-10 : 23:32:22
|
i have tried to execute that query in my environment but i don't get any error message at all. KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|
|