×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Creating Columns

Creating Columns

Creating Columns

(OP)
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....

RE: Creating Columns

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close