?
Solved

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

Posted on 2016-11-13
2
Medium Priority
?
93 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

770 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