In 2010, I had a custom screen built out that exports our customer data. One
of the fields is ‘YTD Sales’ that has the following SQL override code to pull
each customer’s YTD sales:
SELECT
Cast(ROUND(Sum(Amount),2) as decimal(9,2))
FROM viewaccInvoice WHERE
viewaccInvoice.Customer = viewaccEntity.FullName AND viewaccInvoice.TxnDate
> cast(year(getdate()) -1 as varchar(4)) + '/12/31' and
viewaccInvoice.TxnDate < cast(year(getdate()) + 1 as varchar(4)) + '/01/01'
I have never had a problem with this grid before, but today this
field is not calculating YTD sales. Every Tuesday I export this grid and send
the data to our IT company; last week I didn’t have any problems and I haven’t
changed anything on the screen. Only a few customers show sales in this field,
all of them have a ‘last invoice date’ of 8/26/11-8/30/11 and their YTD sales
are not ‘YTD’, it is just the total of their order that was invoiced in the
past week. Is there an explanation for why this field would start to calculate 'week to date' sales? I
need to send this file before the end of the day, so any help/suggestions is
appreciated.
Thanks, BIrch