OK, Jan,

You have to make sure the first union gets the data types right.

SET VAR vTmpCurr CURRENCY = 0.00

Use .vTmpCurr instead of the zeros in the first section

cre temp vie vduesact (DMonth,DuesPer,TIamt,TPAmt,TCAmt) as sel 
idate,(((iyr4(idate))*100)+(imon(idate))),+
 (.vTmpCurr ),(sum(iamt)),( .vTmpCurr ) from vcie where idate >= (.vdrpb) and 
acctid = '401' group by idate +

This will cause the view to use currency datatypes.
The zeros in the other 2 sections are ok as the datatypes are already defined 
by the first section.

Dennis McGrath



________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jan Barley
Sent: Monday, October 27, 2008 9:13 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Union Select

Dennis,
Here it is:

cre temp vie vduesact (DMonth,DuesPer,TIamt,TPAmt,TCAmt) as sel 
idate,(((iyr4(idate))*100)+(imon(idate))),+
  0,(sum(iamt)),0 from vcie where idate >= (.vdrpb) and acctid = '401' group by 
idate +
union sel pdate,(((iyr4(pdate))*100)+(imon(pdate))),+
  (sum(pamt)),0,0 from vcie where pdate >= (.vdrpb) and acctid = '401' group by 
pdate +
union sel pdate,(((iyr4(pdate))*100)+(imon(pdate))),+
  0,0,(sum(iamt)) from vcie where pdate >= (.vdrpb) and acctid = '401' and 
payway = 'cancel' group by pdate

Thanks!

Jan

Reply via email to