First record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to group data so that I can see the total risk applicable to a
merchant ID and name of merchant. The names of the same merchant are
recorded in differing ways but all have the same merchant ID. I've tried
using the first command below but it still returns all merchant IDs and all
merchant names without showing one merchant ID, one merchant name and one
risk number. Please help.

SELECT First(Data.chn_corp) AS FirstOfchn_corp, Data.dba_name,
Sum(Data.actlrskmtd) AS SumOfactlrskmtd
FROM Data
GROUP BY Data.dba_name, Data.pr_peak_risk, Data.pr_curr_risk, Data.sales,
Data.date_clsd
HAVING (((First(Data.chn_corp))<>"000000000000") AND
((Sum(Data.actlrskmtd))>0 And (Sum(Data.actlrskmtd))<150) AND
((Data.pr_peak_risk)=0) AND ((Data.pr_curr_risk)=0) AND ((Data.sales)>0) AND
((Data.date_clsd)="/ /"))
ORDER BY First(Data.chn_corp);
 
Which is the Merchant ID field and Name of Merchant field? Group by the
Merchant ID field and NOT Merchant field. Do a First on the Name of Merchant.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top