Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Over the past year I have found your site to be EXCELLENT. Never have I been able to find so many answers to such vast problems and it is an excellent service..."

Geography

Where in the world do Tek-Tips members come from?
grecon (TechnicalUser)
16 May 12 16:17
I keep getting an error the ) is missing but I can't figure out where

sum(({ORDERHDR.ORDER_TOT})where year = '2012') -sum ({ORDERHDR.ORDER_TOT}where year = '2011'))
CoSpringsGuy (IS/IT--Management)
16 May 12 16:40
NOT SURE ABOUT THE FORMULA AS A WHOLE BUT YOU NEED ANOTHER ) AFTER THE SECOND sum ({ORDERHDR.ORDER_TOT}

_____________________________________
Crystal Reports 2008 and XI
Intersystems Cache 2012 ODBC connection

Madawc (Programmer)
17 May 12 5:51
sum ({ORDERHDR.ORDER_TOT}where year = '2011')) should be
sum ({ORDERHDR.ORDER_TOT})where year = '2011'))

yinyang Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP yinyang

Madawc (Programmer)
17 May 12 5:52
sum ({ORDERHDR.ORDER_TOT}where year = '2011')) should be
sum ({ORDERHDR.ORDER_TOT})where year = '2011')

yinyang Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP yinyang

Madawc (Programmer)
17 May 12 5:53
sum ({ORDERHDR.ORDER_TOT}where year = '2011')) should be
sum ({ORDERHDR.ORDER_TOT})where year = '2011')

Maybe easier if you define them as named sum fields. The use of Crystal's automated totals is outlined at FAQ767-6524: Basics of totals.

yinyang Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP yinyang

Madawc (Programmer)
17 May 12 5:55
Sorry about the repetition. The new replies system is an improvement but seems not to let you know when it has successfully posted.

yinyang Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP yinyang

lbass (TechnicalUser)
19 May 12 9:46
Where are you trying to put this formula? It won't work. You need to make formulas like this:

//{@2011tot}:
if {table.date} =2011 then {ORDERHDR.ORDER_TOT}

//{@2012tot}:
if {table.date} =2012 then {ORDERHDR.ORDER_TOT}

Then in the report footer, use:

sum({@2012tot})-sum({@2011tot})

If you are doing this at some group level, you would have to add in a group condition and place in a group header or group footer:

sum({@2012tot},{table.groupfield})-sum({@2011tot},{table.groupfield})

-LB

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!

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