|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
create function SvensktDatum2(@indate datetime, @separator char(1))
returns nchar(20) as begin return convert(nvarchar(20), datepart(yyyy, @indate)) + @separator declare @manad nvarchar(20) if (datepart(mm, @indate)between 1 and 6) begin set @manad ='0'+ (datepart(mm, @indate)) + convert(nvarchar(20), @manad) end else begin set @manad = (datepart(mm, @indate)) + convert(nvarchar(20), @manad) end + @separator declare @dag nvarchar(20) if (datepart(dd, @indate)between 1 and 6) begin set @dag ='0'+ (datepart(dd, @indate)) + convert(nvarchar(20), @dag) end else begin set @dag = (datepart(dd, @indate)) + convert(nvarchar(20), @dag) end end I get this message: Server: Msg 170, Level 15, State 1, Procedure SvensktDatum2, Line 20 Line 20: Incorrect syntax near '+'. Last edited by buggirl : September 25th, 2003 at 03:14 PM. |
|
#2
|
||||
|
||||
|
The error message seems pretty clear to me.. See line 20 of your stored proc where it says:
+ @separator That section seems to be by itself and is not part of any expression or anything .BTW are you a Swedish speaker by any chance?
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
|||
|
|||
|
Well now, I've solved my problem and yes I am a Swedish speaker!!!
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > what is wrong??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|