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!

Formula help

Status
Not open for further replies.

grecon

Technical User
Mar 8, 2007
78
0
0
US
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'))
 
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

 
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]
 
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]
 
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.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
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]
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top