S
snoo_yp
I use a query as the report source. When not selecting group, everything
seems fine, but when I try to group by name, some of the data was missing.
Can anyone help ?
Here's my query:
SELECT custlisting.Name, custlisting.GroupName, custlisting.Policyno,
custlisting.[2DSUM], custlisting.[3DSUM], custlisting.LADYSUM, custlisting.
ACCSUM, custlisting.HOSSUM, custlisting.HOS
FROM custlisting
ORDER BY custlisting.custid;
Result:
Name Groupname Policyno Premium 2dsum 3dsum Ladysum
Accsum Hossum
Tan TT xxxxxxx 135.45 20,
000
Tan TT yyyyyyy 854.25 30,
000 20,000 50,000
Tan TT zzzzzzz 586.00
Jing TT kkkkkkk 965.25
But when I group under Name, it only show:
ame Groupname Policyno Premium 2dsum 3dsum Ladysum
Accsum Hossum
Tan TT xxxxxxx 135.45
Tan TT yyyyyyy 854.25
Tan TT zzzzzzz 586.00
Jing TT kkkkkkk 965.25
why ??
This query actually base on another query , which is as follow:
SELECT customer.CustID, customer.Name, Group.GroupName, PayMode.Shortname,
Policy.Policyno, Policy.commdate, Policy.sumassrued AS Poassured, Policy.
premium, Policy.nominee, Policy.waiver, plancat.CatCode, plancat.PlanCode,
plancat.sumassured AS plansum, Group.GroupID, Company.CompanyCode, (select
top 1 custrider.subassured from custrider where custrider.policyid=policy.
policyid and custrider.catcode="2D" ) AS 2DSUM, (select top 1 custrider.
subassured from custrider where custrider.policyid=policy.policyid and
custrider.catcode="3D" ) AS 3DSUM, (select top 1 custrider.subassured from
custrider where custrider.policyid=policy.policyid and custrider.
catcode="LADY" ) AS LADYSUM, (select top 1 custrider.subassured from
custrider where custrider.policyid=policy.policyid and custrider.
catcode="ACC" ) AS ACCSUM, (select top 1 custrider.subassured from custrider
where custrider.policyid=policy.policyid and custrider.catcode="HOS" ) AS
HOSSUM, (select top 1 custrider.ridercode from custrider where custrider.
policyid=policy.policyid and custrider.catcode="HOS" ) AS HOS
FROM ((((Policy LEFT JOIN customer ON Policy.CustID=customer.CustID) LEFT
JOIN [Group] ON customer.Group=Group.GroupID) LEFT JOIN PayMode ON Policy.
paymodeid=PayMode.Paymodeid) LEFT JOIN plancat ON Policy.planid=plancat.
PlanID) LEFT JOIN Company ON Policy.company=Company.CompanyID
WHERE ((([group.groupid])=forms![group Range]!cbogroup));
seems fine, but when I try to group by name, some of the data was missing.
Can anyone help ?
Here's my query:
SELECT custlisting.Name, custlisting.GroupName, custlisting.Policyno,
custlisting.[2DSUM], custlisting.[3DSUM], custlisting.LADYSUM, custlisting.
ACCSUM, custlisting.HOSSUM, custlisting.HOS
FROM custlisting
ORDER BY custlisting.custid;
Result:
Name Groupname Policyno Premium 2dsum 3dsum Ladysum
Accsum Hossum
Tan TT xxxxxxx 135.45 20,
000
Tan TT yyyyyyy 854.25 30,
000 20,000 50,000
Tan TT zzzzzzz 586.00
Jing TT kkkkkkk 965.25
But when I group under Name, it only show:
ame Groupname Policyno Premium 2dsum 3dsum Ladysum
Accsum Hossum
Tan TT xxxxxxx 135.45
Tan TT yyyyyyy 854.25
Tan TT zzzzzzz 586.00
Jing TT kkkkkkk 965.25
why ??
This query actually base on another query , which is as follow:
SELECT customer.CustID, customer.Name, Group.GroupName, PayMode.Shortname,
Policy.Policyno, Policy.commdate, Policy.sumassrued AS Poassured, Policy.
premium, Policy.nominee, Policy.waiver, plancat.CatCode, plancat.PlanCode,
plancat.sumassured AS plansum, Group.GroupID, Company.CompanyCode, (select
top 1 custrider.subassured from custrider where custrider.policyid=policy.
policyid and custrider.catcode="2D" ) AS 2DSUM, (select top 1 custrider.
subassured from custrider where custrider.policyid=policy.policyid and
custrider.catcode="3D" ) AS 3DSUM, (select top 1 custrider.subassured from
custrider where custrider.policyid=policy.policyid and custrider.
catcode="LADY" ) AS LADYSUM, (select top 1 custrider.subassured from
custrider where custrider.policyid=policy.policyid and custrider.
catcode="ACC" ) AS ACCSUM, (select top 1 custrider.subassured from custrider
where custrider.policyid=policy.policyid and custrider.catcode="HOS" ) AS
HOSSUM, (select top 1 custrider.ridercode from custrider where custrider.
policyid=policy.policyid and custrider.catcode="HOS" ) AS HOS
FROM ((((Policy LEFT JOIN customer ON Policy.CustID=customer.CustID) LEFT
JOIN [Group] ON customer.Group=Group.GroupID) LEFT JOIN PayMode ON Policy.
paymodeid=PayMode.Paymodeid) LEFT JOIN plancat ON Policy.planid=plancat.
PlanID) LEFT JOIN Company ON Policy.company=Company.CompanyID
WHERE ((([group.groupid])=forms![group Range]!cbogroup));