Dear Marc,
Try your UNION SELECT without the 'AS xxxx' in the
second group representing 'payments.'
Once you establish the column name, you do not need to
re-define the column names. Just add data.
You might also remove =S from SUM(t1.ch_price)=S=9
since you are adding rows, and there would be no place for a
subtotal.
Randy Peterson
marc schluter wrote:
> Hi all
>
> Is there anything wrong with the code below?
> Sometimes it works OK in trace but crashes RBW when
> run in a command file. I have tried it on sever data
> bases and the same results
>
> thanks marc
>
> BROWSE +
> t1.custnum=7 AS Pat#, t2.f_name=12 AS FIRST,
> t2.l_name=12 AS LAST,+
> 'Charges'=8 AS Service, SUM(t1.ch_price)=9 AS Amount +
> FROM tran_daily t1,ptinfo t2 +
> WHERE t1.custnum = t2.custnum AND t1.tr_type = 1 +
> GROUP BY t1.custnum,t2.f_name,t2.l_name,t1.tr_type +
> union select +
> t1.custnum=7 AS Pat#,t2.f_name=12 AS FIRST,
> t2.l_name=12 AS LAST,+
> 'payments'=8 AS Service, SUM(t1.ch_price)=S=9 AS
> Amount +
> FROM tran_daily t1,ptinfo t2 +
> WHERE t1.custnum = t2.custnum AND t1.tr_type = 2 +
> GROUP BY t1.custnum,t2.f_name,t2.l_name,t1.tr_type
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com