Forums
This topic is locked
any SQL guru's for UltraDev? Help
13 Jul 2001 00:17:50 Ray Mr. posted:
I have a SQL query that works fine in the SQL 2000 query analyzer.SELECT Stmnt_cat, Stmnt_cat_desc, Chrg_type, Call_group,
Call_group_desc, Chrg_amt_1, Chrg_amt_2
FROM CallGrpSumChrgsCustomer
WHERE (Invoice_date = '06/03/01') AND (Cust_no = '0000000003')
GROUP BY Stmnt_cat, Stmnt_cat_desc, Chrg_type, Call_group, Call_group_desc,
Chrg_amt_1, Chrg_amt_2
ORDER BY Stmnt_cat, Chrg_type, Call_group
COMPUTE SUM(Chrg_amt_1)By Stmnt_cat, Chrg_type
COMPUTE SUM (Chrg_amt_1)
The query above calculates a total for a subgroup and then a total for an
outer group.
But when I add this into the UltraDev query recordset..in the Advanced I
don't get the same results?
It just shows the first part of the recordset results.....it doesn't show
the other break down such as sum ?
Any suggestions or help...
thanks in advance.....
Replies
Replied 13 Jul 2001 01:10:21
13 Jul 2001 01:10:21 Viktor Farcic replied:
You should put last two line in select:
SELECT Stmnt_cat,..., Sum(RSField) AS Something
Change 'RSField' to name of the field you want to compute and 'Something' to name which will be showen in resuls.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I have a SQL query that works fine in the SQL 2000 query analyzer.
SELECT Stmnt_cat, Stmnt_cat_desc, Chrg_type, Call_group,
Call_group_desc, Chrg_amt_1, Chrg_amt_2
FROM CallGrpSumChrgsCustomer
WHERE (Invoice_date = '06/03/01') AND (Cust_no = '0000000003')
GROUP BY Stmnt_cat, Stmnt_cat_desc, Chrg_type, Call_group, Call_group_desc,
Chrg_amt_1, Chrg_amt_2
ORDER BY Stmnt_cat, Chrg_type, Call_group
COMPUTE SUM(Chrg_amt_1)By Stmnt_cat, Chrg_type
COMPUTE SUM (Chrg_amt_1)
The query above calculates a total for a subgroup and then a total for an
outer group.
But when I add this into the UltraDev query recordset..in the Advanced I
don't get the same results?
It just shows the first part of the recordset results.....it doesn't show
the other break down such as sum ?
Any suggestions or help...
thanks in advance.....
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Edited by - vfarcic on 07/13/2001 01:13:35
SELECT Stmnt_cat,..., Sum(RSField) AS Something
Change 'RSField' to name of the field you want to compute and 'Something' to name which will be showen in resuls.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I have a SQL query that works fine in the SQL 2000 query analyzer.
SELECT Stmnt_cat, Stmnt_cat_desc, Chrg_type, Call_group,
Call_group_desc, Chrg_amt_1, Chrg_amt_2
FROM CallGrpSumChrgsCustomer
WHERE (Invoice_date = '06/03/01') AND (Cust_no = '0000000003')
GROUP BY Stmnt_cat, Stmnt_cat_desc, Chrg_type, Call_group, Call_group_desc,
Chrg_amt_1, Chrg_amt_2
ORDER BY Stmnt_cat, Chrg_type, Call_group
COMPUTE SUM(Chrg_amt_1)By Stmnt_cat, Chrg_type
COMPUTE SUM (Chrg_amt_1)
The query above calculates a total for a subgroup and then a total for an
outer group.
But when I add this into the UltraDev query recordset..in the Advanced I
don't get the same results?
It just shows the first part of the recordset results.....it doesn't show
the other break down such as sum ?
Any suggestions or help...
thanks in advance.....
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Edited by - vfarcic on 07/13/2001 01:13:35