PDA

View Full Version : Must declare the scalar variable "@FromDate"



dottnett
یک شنبه 22 تیر 1393, 12:28 عصر
سلام دوستان

من استورپروسیجر زیر رو نوشتم

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go








ALTER PROCEDURE [dbo].[DescriptionPerformance]
@Account int,
@FromDate nvarchar[10]


AS


BEGIN


--select Vot_Date as [تاریخ],description as [توضیحات],Fee as [فی],Debit as [بدهکار],Credit as [بستانکار] from Account inner join
--Vnumber on Account.Vot_no=Vnumber.Vot_no where Account='10700' and Vot_Date >='1393/02/14' and Vot_Date<='1393/02/14'


select Vot_Date as [تاریخ],description as [توضیحات],Fee as [فی],Debit as [بدهکار],Credit as [بستانکار] from Account
inner join Bills on Account.BillsId=Bills.BillsId inner join
Vnumber on Account.Vot_no=Vnumber.Vot_no where Account.Account=@Account and Vot_Date>= @FromDate and Vot_Date<=@ToDate
END


go
اما ارور بالا رو میده زمان اجرا..کسی میدونه برای چیه؟لطفا کمک کنید..ممنون

dottnett
یک شنبه 22 تیر 1393, 12:30 عصر
فیلد @ToDate هم تعریف شده بوده الان پاک شده..

dottnett
یک شنبه 22 تیر 1393, 19:06 عصر
خودم پیدا کردم
در تعریف متغییر fromDate به جای کوروشه باید از پرانتز استفاده میکردم
(FromDate nvarchar(10@