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 - 2003-08-07 : 07:43:24
|
| Rajesh writes "I am passing input variable as a datetime to a stored procedure How to compare date variable with datetime column.Does I require to covert the variable while comparing ?CREATE PROCEDURE PROC_SETTLEMENT (@TrdSettlementDate)ASBEGINSELECT * FROM Settlement where @TrdSettlementDate >= @StartDate and @TrdSettlementDate <=@EndDateEND" |
|
|
Andraax
Aged Yak Warrior
790 Posts |
Posted - 2003-08-07 : 07:47:01
|
| No, but you have to type the parameter. Also, BEGIN and END are not necessery in this case. I presume StartDate and EndDate are columns in the table and not variables/parameters? So you have to lose the @:CREATE PROCEDURE PROC_SETTLEMENT (@TrdSettlementDate datetime)ASSELECT * FROM Settlement where @TrdSettlementDate >= StartDate and @TrdSettlementDate <= EndDate |
 |
|
|
|
|
|