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 |
|
cheesecake
Starting Member
11 Posts |
Posted - 2010-09-10 : 15:39:46
|
| IF OBJECT_ID(N'dbo.Price_Distribution') IS NOT NULLDROP Table Price_DistributionGODECLARE @activedate smalldatetime;SET @activedate = '2010-07-16 12:00:00 AM'select saledate from nc_price_distributionINSERT Price_Distribution (VehicleId, StandardDeviation, IntervalHigh, IntervalLow, Imputed)SELECT KBBVehicleId , STD_EST , Price_UCLM , Price_LCLM , CASE imputed WHEN 'NO' Then 0 ELSE 1 ENDFROM NC_Price_Distribution WHERE Price_UCLM is not null and Price_LCLM is not nullAND Percentage = 1 AND SALEDATE >= DateAdd(dd,-6, @activedate) AND SALEDATE <= @activedateMust declare the scalar variable "@activedate".If I execute the above, I am getting the error "Must declare the scalar variable "@activedate".. How can I correct this? Please advise. Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|