|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQ@L Query help for MS Access
I have two table
Table 1- Forecast Fields - Accounting Period (pull up from another table Accounting period Master - Vendor Name (Pull up from vendor Master table) - Resource Name (Pull up from Resource master table) - Sub Code (Pull up from Sub code master - Forecast Amount Table 2 Invoice Fields - Accounting Period (pull up from another table Accounting period Master) - Vendor Name (Pull up from vendor Master table) - Resource Name (Pull up from Resource master table) - Sub Code (Pull up from Sub code master - Invoice Amount There are other fields also in those tables but will not concern the present Purpose My objective is to write a query Which throws up the forecast and Actuals in a columnar fashion for different account periods. Eg. Accting period 1 Forecast & Actual, Acouting period 2 Forecast Actual ect ect....... Grouped by Sub code, vendor name Resource name This list i need for all resources who are either forecasted for or for whom there are actuals. The current query i have written is: TRANSFORM Sum([Invoice].[Amount]) AS SumOfAmount SELECT [invoice].[Sub Code], [invoice].[Vendor Name], [invoice].[Resource Name], [invoice].[Accounting Period] FROM invoice GROUP BY [invoice].[Sub Code], [invoice].[Vendor Name], [invoice].[Resource Name], [invoice].[Accounting Period], [invoice].[Sub Code], [invoice].[Resource Name] ORDER BY [invoice].[Accounting Period], [invoice].[Vendor Name] PIVOT [invoice].[Accounting Period]; This outputs the actuals data the way I want it. Now I need to get the forecast data in columnar form within this query. I have tried some option but have been unsuccessful. Pls Help!!!!!! |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > SQ@L Query help for MS Access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|