MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 26th, 2004, 01:13 PM
Rajeshhariharan Rajeshhariharan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: CA, USA
Posts: 6 Rajeshhariharan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!!!!!!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > SQ@L Query help for MS Access


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT