|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem adding days to a date using DATEADD
I am trying to pass a stored procedure a variable that allows the user to specify how may days should be added to the date. I am getting an error since I'm not 100% sure how I need to declare the variable I am using int currently and the date add function look like:
DATEADD(dd, ' + @DaysToadvnce + ', ''' + cast(@today as nvarchar(50)) + ''')) the actual query is a string also. Any help would be much appreciated, Thanks. |
|
#2
|
|||
|
|||
|
I figured out what I needed to do:
DATEADD(dd, ' + cast(@DaysToadvnce as nvarchar(50) + ', ''' + cast(@today as nvarchar(50)) + ''')) |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Problem adding days to a date using DATEADD |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|