468,161 Members | 1,952 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,161 developers. It's quick & easy.

Form Chart Expression??

1
Hello all,

Originally, my goal was only to select all records in the "forecast_info" table where the table field "f_model" was equal to the content of a form field "v_model". I was able to achieve this with the following query.
Expand|Select|Wrap|Line Numbers
  1. PARAMETERS [Forms]![vehicle_info_form]![v_model] Text ( 255 );
  2. SELECT forecast_info.f_model, forecast_info.f_year, forecast_info.f_production, forecast_info.f_sales
  3. FROM forecast_info
  4. WHERE (((forecast_info.f_model)=[Forms]![vehicle_info_form]![v_model]));
I took the results of this query (called QUERYmodelname_forecast) and displayed them in a form chart. One chart for sales (f_sales) and one chart for production (f_production). Here is the SQL behind the Production form chart:
Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Sum(QUERYmodelname_forecast.f_production) AS SumOff_production
  2. SELECT QUERYmodelname_forecast.f_year
  3. FROM QUERYmodelname_forecast
  4. GROUP BY QUERYmodelname_forecast.f_year
  5. PIVOT QUERYmodelname_forecast.f_model;
Now my dilemma... now my task is to create this same graphs with the same original criteria of the first SQL. However, there are now 2 production forecasts . In other words, there will be "f_productionA" and "f_productionB". I need to apply the sum of "f_productionA" and "f_productionB" in place of "f_production" in the chart. I'm at a loss for how to go about this. I tried creating expressions and dabbled in a Lookup Wizard type field but didn't get very far with either. What do you guys suggest as the best way to accomplish this? Hopefully I explained clearly...

Thanks in advance.
Dec 11 '07 #1
1 1269
PianoMan64
374 Expert 256MB
Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Sum(QUERYmodelname_forecast.f_productionA) + Sum(QUERYmodelname_forecast.f_productionB) AS SumOff_production
  2. SELECT QUERYmodelname_forecast.f_year
  3. FROM QUERYmodelname_forecast
  4. GROUP BY QUERYmodelname_forecast.f_year
  5. PIVOT QUERYmodelname_forecast.f_model;
  6.  
Jan 5 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Thelma Lubkin | last post: by
7 posts views Thread by John | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by kamranasdasdas | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.