By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,397 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,397 IT Pros & Developers. It's quick & easy.

Form Chart Expression??

P: 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
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 374
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.