Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Beginner problem, need help with hard coding my report

Status
Not open for further replies.

hoggle

Programmer
Jul 13, 2001
124
US

I have a view created in SQL server 2000, which contains (recItemNum, recMonth, recYear, recManagerNum, recCustNum)
recMonth holds a numeric value 1-12 (for the month)
and recYear holds 2003-2004

now I want to build a report so it looks like this:
recMonth 1-12
then have recQauntity show up under the correct month

header:
1 2 3 4 5 ..... 12
details:
(value of recQuantity for month = 1) (value of recQuantity for month = 2) ...........

how can I do this...please forgive me if this makes no sense.
 
I can kind of tell I need to do this, but it isn't working
If {v_Forecast_Cascade_Generated_by_itemNum_by_Manager1.recMonth} = "10" Then Q10 = {v_Forecast_Cascade_Generated_by_itemNum_by_Manager1.recQuantity} end if

Q10 is the name of my field.
 
You've nearly got your head around it. What you really want is this:

WhilePrintingRecords;
NumberVar Q9;
NumberVar Q10;

If {v_Forecast_Cascade_Generated_by_itemNum_by_Manager1.recMonth} = "9"
Then Q9 := {v_Forecast_Cascade_Generated_by_itemNum_by_Manager1.recQuantity}
Else
If {v_Forecast_Cascade_Generated_by_itemNum_by_Manager1.recMonth} = "10"
Then Q10 := {v_Forecast_Cascade_Generated_by_itemNum_by_Manager1.recQuantity};

...that only covers two of the twelve variables you'll need, but I'm sure you get the picture.

Then, place twelve different versions of this formula in the details section to create your columns:

WhilePrintingRecords;
NumberVar Q1;

Increment the Q# for each new formula.

You can also achieve the same thing by creating a twelve array component and splitting it up.

Naith
 
I just realised that you said that {v_Forecast_Cascade_Generated_by_itemNum_by_Manager1.recMonth} is a numeric field. This means that you do not need the quotes around the '= "9"' and '= "10"' part. It's just ' = 9' without the quotes.

Naith
 
that worked! I figured on was on the right track just needed a little push
thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top