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 |
|
Mazdak
Yak Posting Veteran
63 Posts |
Posted - 2002-10-23 : 02:44:29
|
| Could someonehelp me to write this stored procedure?I have two datetime column and ID column(its integer).I pass an ID to stored procedure and want to check if today is between these two date,and return true or false.Thanks |
|
|
LarsG
Constraint Violating Yak Guru
284 Posts |
Posted - 2002-10-23 : 04:34:37
|
| T-sql does not support a boolean type, so you have to use something else. create procedure Mazdak(@id int)asif exists(select 1 from t where id = @id and datetime1 between current_timestamp and datetime2 )return 1elsereturn 0 |
 |
|
|
|
|
|