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

Math on SELECT column

Status
Not open for further replies.

shagymoe

Programmer
Apr 20, 2001
72
US
I have one column which I would like to perform a math operation on and I can't figure it out. I really hate Crystal Reports, but it is good for some things. Anyway, here is a simple example with the output and below that will be what I WANT.
NOW:
Code:
SELECT date, sequence, group FROM table where stuff;

CURRENT OUTPUT:
DATE SEQUENCE GROUP
01-JAN-03 5555555 39

WHAT I WANT TO DO:
Code:
SELECT date, sequence, group - 19 FROM table where stuff;

OUTPUT I WANT:
DATE SEQUENCE GROUP
01-JAN-03 5555555 20

All I want to do is the simple math on the GROUP column. I tried manually editing the SQL Query from the "DATABASE=>SHOW SQL QUERY" menu and that doesn't work. I tried adding a math operation, but couldn't get it to work.

Can someone, ANYONE help me with this? It is so annoying because I think you should just be able to use ANSI SQL and modify the statment however you want and use the pretty GUI stuff if necessary. I know SQL well and this just makes me feel stupid...I can't do a simple math operation. UUUGGGHHH!


 
You don't mention which version of Crystal you are using, but this is easily handled with a SQL expression (what they are designed for).

Create a SQL expression:

table.group -19

If you have and older version of crystal you will need to do this in a formula after the data has returned from the DB.

Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top