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 |
|
ri16
Yak Posting Veteran
64 Posts |
Posted - 2008-03-04 : 10:16:41
|
| i have seen that date function which MVJ has created and its really very useful..but i m getting error while selecting getdate() as @last_date in that functionSELECT distinct date FROM dbo.F_TABLE_DATE('1/1/1999', getdate()) AS Date error is : Incorrect syntax near 'getdate'what's mistake?can anyone help me?thanks in advance. |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-03-04 : 10:24:32
|
| [code]Declare @dt datetimeset @dt = GetDate()SELECTdistinct date FROMdbo.F_TABLE_DATE('1/1/1999', @dt) AS Date [/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
ri16
Yak Posting Veteran
64 Posts |
Posted - 2008-03-04 : 10:54:54
|
| Thanks Harsh.Got it!! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-03-04 : 11:05:11
|
| Bote that you cant directly pass getdate() as parameter to a function or procedureMadhivananFailing to plan is Planning to fail |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2008-03-05 : 15:24:31
|
quote: Originally posted by madhivanan Bote that you cant directly pass getdate() as parameter to a function or procedure
Did that change with 2005? I'm able to pass GETDATE() or CURRENT_TIMESTAMP directly to function without issue.. |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2008-03-05 : 15:30:07
|
| Looks like they did change it with 2005, probably to support cross apply.It does not work in SQL 2000, so this was probably posted on the wrong forum.CODO ERGO SUM |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-03-06 : 08:05:21
|
quote: Originally posted by Lamprey
quote: Originally posted by madhivanan Bote that you cant directly pass getdate() as parameter to a function or procedure
Did that change with 2005? I'm able to pass GETDATE() or CURRENT_TIMESTAMP directly to function without issue..
Yes it is changed in SQL Server 2005Also you can very well use GETDATE() inside UDFMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|