?
Solved

The remaining text does not appear to be part of the formula error

Posted on 2016-11-13
2
Medium Priority
?
153 Views
Last Modified: 2016-11-13
Crystal Reports 2016

I have a formula where I want to sum a field based on a Datetime field called E911Data.EntryDateTime using a parameter value -1 to get the records from the previous year then that of the year contained in the parameter.

I get a The remaining text does not appear to be part of the formula error after sum({E911Data.Agency}).  What is causing this error?


sum({E911Data.Agency}) where Year({E911Data.EntryDateTime}) = {?Pm-?Year} -1
0
Comment
Question by:MikeM670
2 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 41885798
Crystal doesn't have a WHERE clause on the sum

To do this you need 2 formulas

Value Formula
Name - PreviousYearValues
If  Year({E911Data.EntryDateTime}) = {?Pm-?Year} -1  then
    {E911Data.Agency}
Else
     0

Open in new window


The second formula does the sum
Name - SumPreviousYear
Sum({@PreviousYearValues})

Open in new window


Create both formulas
Put the SUM formula on the report where you need the sum displayed.  The other formula doesn't have to be on the report.

Another way to do this would be to drop the value formula on the report
YOu can then RIGH CLICK it and select summary
Set up the summary as a sum and put in the footers where you want it

mlmcc
0
 

Author Closing Comment

by:MikeM670
ID: 41885809
Thanks.  I did not realize you could not use a Where clause with a Sum().  Sometimes I tend to test things in sql before crystal.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question