I am using Crystal XI on SQL Server. I've created an SQL Expression to get the sum of sub_amts for last year to date. However, every time I save it, Crystal freezes. Anyone have any suggestions and what I can do to resolve this issue? Thanks!
(
select sum(ivc2."sub_amt")
from invoice ivc2
join sales_register
on ivc2."customer_id" = "sales_register"."customer_id"
where ivc2."invoice_date" BETWEEN
DateAdd(yyyy, DateDiff(yyyy, 365, GetDate()), 0)
and DateAdd(dd, DateDiff(dd, 365, GetDate()) +1, 0)
)
(
select sum(ivc2."sub_amt")
from invoice ivc2
join sales_register
on ivc2."customer_id" = "sales_register"."customer_id"
where ivc2."invoice_date" BETWEEN
DateAdd(yyyy, DateDiff(yyyy, 365, GetDate()), 0)
and DateAdd(dd, DateDiff(dd, 365, GetDate()) +1, 0)
)