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 |
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2011-02-08 : 04:16:39
|
Hi I have the following function in my query in a report and im trying to use a parameter but it complains about the arguement being nvarchar.DATEADD(dd, @days, GETDATE())is it not possible to use this?it is currenrly DATEADD(dd, -7, GETDATE()) |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2011-02-08 : 04:23:59
|
How is @days variable declare? As SMALLINT, INT or NVARCHAR? N 56°04'39.26"E 12°55'05.63" |
 |
|
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2011-02-08 : 04:51:48
|
I havent declared, the parameter just added it in.DECLARE @PreviousDate datetimeSET @PreviousDate = DATEADD(dd, -7, GETDATE())----quote: Originally posted by Peso How is @days variable declare? As SMALLINT, INT or NVARCHAR? N 56°04'39.26"E 12°55'05.63"
|
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2011-02-08 : 05:08:58
|
quote: Originally posted by cipriani1984 ...it complains about the arguement being nvarchar.DATEADD(dd, @days, GETDATE())
N 56°04'39.26"E 12°55'05.63" |
 |
|
yadhu_cse
Constraint Violating Yak Guru
252 Posts |
Posted - 2011-03-03 : 01:17:50
|
use convert() |
 |
|
|
|
|