I have a query in SQL 2005 that I want to convert to a formula. Here is my query:
declare @todays as datetime
set @todays ='02/15/2010'
select DatePayment , sum(dollarsunallocated)
from VWr_Insurance_Payment
where dollarsunallocated >0
and datepayment >= (@todays -30)
group by datepayment,payorname
I created this formula
if date ({TPr_InsPayments;1.DatePayment}) in
{?@todate} - {?Period A} to
{?@todate}
then Sum ({TPr_InsPayments;1.DollarsUnallocated},{@Group - Payor Name} )
else 0
but it is not working correctly
can anyone help me with this?