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 |
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2007-05-04 : 15:58:41
|
| Can someone help me debug the function below?create Function [dbo].[fnNo1900]( @date datetime )returns datetimebegin declare @newdate datetimeset @newdate = case when @date = '01/01/1900' then @newdate = '01/01/2999' else @newdate = @dateend return @newdateend |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-05-04 : 16:02:01
|
| Sure, but what is the problem? What exactly do you want us to debug? What are you expecting?Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
sshelper
Posting Yak Master
216 Posts |
Posted - 2007-05-04 : 16:02:49
|
| Try this updated query:set @newdate = case when @date = '01/01/1900'then '01/01/2999'else @dateendSQL Server Helperhttp://www.sql-server-helper.com |
 |
|
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2007-05-04 : 16:05:16
|
| Thank you.I try again, it works as sshelper. |
 |
|
|
|
|
|