Declare
@CurrentYear_StartDate As DateTime,
@CurrentYear_EndDate As DateTime,
@TodaysDate As DateTime,
@CurrentYear As int
set @CurrentYear = year(getdate())
set @CurrentYear_StartDate = convert(DateTime, '01/01/' + cast(@CurrentYear As varchar))
set @CurrentYear_EndDate = convert(DateTime, '12/31/' + cast(@CurrentYear As varchar))
Select custnmbr, custname, sum(Docamnt) As CurrentYear_Invoice
From sop30200 c
Where DocDate >= @CurrentYear_StartDate and DocDate <= @CurrentYear_EndDate and SOPType=3 and Voidstts=0
Group By Custnmbr, Custname
Wednesday, August 6, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment