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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-12-18 : 06:33:26
|
| Ajay writes "i am developing a softwre in Vband connected it to sqli don't know how to handleSELECT * from anytable where anytable.date >=" + MydateVariable1 + " AND anytable.date <=" + MydateVariable2Please suggest me what is the right syntex for writing date in sql query" |
|
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2002-12-18 : 06:42:52
|
quote: Ajay writes "i am developing a softwre in Vband connected it to sqli don't know how to handleSELECT * from anytable where anytable.date >=" + MydateVariable1 + " AND anytable.date <=" + MydateVariable2Please suggest me what is the right syntex for writing date in sql query"
SELECT * from anytable where anytable.date >=@MydateVariable1 AND anytable.date <=@MydateVariable2 this is the way we do it in sql i am not sure how it is done in vb.i guess u will have to use sp_executesql.set @sql='SELECT * from anytable where anytable.date >= +' @MydateVariable1 '+ AND anytable.date <= + '@MydateVariable2 'sp_executesql @sqlExpect the UnExpected |
 |
|
|
|
|
|