Good Morning:
I have 12 [CreditRegionNam e] and 3 [ProductType]. I created the below query:
[code=sql]
SELECT [CreditRegionNam e], [ProductType], Sum([GWP_PRI]) AS [T_GWP_PRI], Sum([NWP_PRI]) AS [T_NWP_PRI]
FROM UqryProductType Static
WHERE ((([PRIYear])=[forms].[Rpt_Sum_Product].[cboYear]-1) AND (([MonthID])=[forms].[Rpt_Sum_Product].[cbomonth]))
GROUP BY [CreditRegionNam e], [ProductType];
[/code]
When I run this query I want each [CreditRegionNam e] to be displayed as well as its [ProductType] with its corresponding [NWP_PRI] & [GWP_PRI] values.
So at the end of the day I want 36 records in total when I run the query.
Example:
If [CreditRegionNam e] was
UTAH
TEXAS
FLORIDA
And [ProductType] was
APPLES
PEARS
ORANGES
I want the query to display:
[CreditRegionNam e]__[ProductType]__[T_GWP_PRI]__[T_NWP_PRI]
UTAH___________ ____APPLES_____ ______0________ _____45
UTAH___________ ____PEARS______ ______20_______ _____56
UTAH___________ ____ORANGES____ _____0_________ ____0
TEXAS__________ ____APPLES_____ ______11_______ ______74
TEXAS__________ ____PEARS______ ______82_______ ______0
TEXAS__________ ____ORANGES____ _____15________ _____65
Etc.
I do have separate tables that are not part of the above query.
[code=text]
Table Name = tblCreditRegion
Field Type IndexInfo
CreditRegID; AutoNumber; The Credit ID
CreditRegionNam e; Text; Product Name
[/code]
[code=text]
Table Name = tblproduct
Field Type IndexInfo
ProductID; AutoNumber; The Product ID
ProductName; Text; Product Name
ProductType; Text; Product Type
[/code]
But when I include them in the above query, I can not get them to join (Left or Right) to give me the result I am looking for (36 records).
At this point I am at wits end, I believe it can be done but I am starting to lose faith.
If anybody could help, it would be greatly appreciated.
Thanks,
Keith.
I have 12 [CreditRegionNam e] and 3 [ProductType]. I created the below query:
[code=sql]
SELECT [CreditRegionNam e], [ProductType], Sum([GWP_PRI]) AS [T_GWP_PRI], Sum([NWP_PRI]) AS [T_NWP_PRI]
FROM UqryProductType Static
WHERE ((([PRIYear])=[forms].[Rpt_Sum_Product].[cboYear]-1) AND (([MonthID])=[forms].[Rpt_Sum_Product].[cbomonth]))
GROUP BY [CreditRegionNam e], [ProductType];
[/code]
When I run this query I want each [CreditRegionNam e] to be displayed as well as its [ProductType] with its corresponding [NWP_PRI] & [GWP_PRI] values.
So at the end of the day I want 36 records in total when I run the query.
Example:
If [CreditRegionNam e] was
UTAH
TEXAS
FLORIDA
And [ProductType] was
APPLES
PEARS
ORANGES
I want the query to display:
[CreditRegionNam e]__[ProductType]__[T_GWP_PRI]__[T_NWP_PRI]
UTAH___________ ____APPLES_____ ______0________ _____45
UTAH___________ ____PEARS______ ______20_______ _____56
UTAH___________ ____ORANGES____ _____0_________ ____0
TEXAS__________ ____APPLES_____ ______11_______ ______74
TEXAS__________ ____PEARS______ ______82_______ ______0
TEXAS__________ ____ORANGES____ _____15________ _____65
Etc.
I do have separate tables that are not part of the above query.
[code=text]
Table Name = tblCreditRegion
Field Type IndexInfo
CreditRegID; AutoNumber; The Credit ID
CreditRegionNam e; Text; Product Name
[/code]
[code=text]
Table Name = tblproduct
Field Type IndexInfo
ProductID; AutoNumber; The Product ID
ProductName; Text; Product Name
ProductType; Text; Product Type
[/code]
But when I include them in the above query, I can not get them to join (Left or Right) to give me the result I am looking for (36 records).
At this point I am at wits end, I believe it can be done but I am starting to lose faith.
If anybody could help, it would be greatly appreciated.
Thanks,
Keith.
Comment