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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Columns

Status
Not open for further replies.

kfr104

Programmer
Mar 3, 2008
12
0
0
US
Good Day

I have a database with column that contains years and coresponding column that has sales in it. I want to creat indepentet fields in the report that have 2007 Sales and another one that has 2008 sales. I could do the years across and then sum the sales underneath it, but then i will never be albe to subtract the two values. What should I use in the report painter to create and a 2007 sales field and a 2008 field?

Thank you....
 
Kerry-
Have you considered a DEFINE?

something like
DEFINE FILE INPUT
SALES2007/P12 = IF YEAR EQ '2007' THEN SALES ELSE 0;
SALES2008/P12 = IF YEAR EQ '2008' THEN SALES ELSE 0;
SALESDIFF/P12 = SALES2008 - SALES2007;
END
TABLE FILE INPUT
SUM
SALES2007 AS '2007,SALES'
SALES2008 AS '2008,SALES'
SALESDIFF AS 'SALES,CHANGE'
BY WHATEVER SORTFIELD
ON TABLE PCHOLD FORMAT HTML
END
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top