473,395 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Crystal Reports Formula Question

I am writing a comparative financial statement comparing this year to last year this month to last years month. I need to write a formula that will pull this month for last year's data. The table/fields in my database are:

GLPerBal.FiscalPeriod = data is an integer, ie 1 = Jan, 2 = Feb etc
GLPerBal.FiscalYear = data is also an integer, 2,007 = 2007 etc

I have 2 parameters set up, {? Month}, {? Year}, to select the month and year.

This is the best I can come up with so far, and it doesn't work:

if {GLPerBal.FiscalYear} = ({? Year}-1)
and {GLPerBal.FiscalPeriod} = {? Month} then
{GLPerBal.CreditAmt} + {GLPerBal.DebitAmt}

I know this is a little complicated, but there are alot of experienced users on this site. Any help would be appreciated.

Thanks.
Mar 21 '08 #1
1 993
mafaisal
142 100+
Hello

I think U r Passed Parameter is String in any way that is string change to number or alter the formula to just adding val
eg

Expand|Select|Wrap|Line Numbers
  1. if {GLPerBal.FiscalYear} = (val({? Year})-1) 
  2.     and {GLPerBal.FiscalPeriod} =val( {? Month} ) then
  3. {GLPerBal.CreditAmt} + {GLPerBal.DebitAmt}
  4.  
or check database field like CreditAmt or DebitAmt is string or numbers

just Try

Faisal
Mar 21 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
0
by: Matt Fuerst | last post by:
Greetings all, I'm having an issue with my Web application. It's deployed using Crystal Reports 8.0 Developer edition. I have an RPT file with a relatively large number of formulas (30+). I...
0
by: Tim Jones | last post by:
Hey all, I am trying to try get a crytal report running properly. A "Hello World" report that does not add criteria to the record selection formula of the report (either in the development tool,...
1
by: Jerry | last post by:
Hi, I want to create a compound field i.e. CityStateZip and then build a formula that is composed of the 3 data elements .City, .State and .ZIP. I've done this before creating a formula in...
1
by: B. Broadwell | last post by:
I have a report created in Crystal Reports 8 that I'm attempting to use in a ..NET application. I have the following formula that works in the Crystal 8 designer and when the report is run using...
3
by: Brad | last post by:
I know this is the VB group, but maybe somebody knows the answer to this. On a Crystal Report that I am using as a form, it pulls in various dated information. In the fields where there are dates...
3
by: Brad | last post by:
This is the next step of a bigger project that I am working on and I have hit a wall. All forms that I have created for this project are working fine. This is the one that I have a problem...
3
by: Tmuld | last post by:
Hello, I was provided a .rpt file which is Crystal Reports report. It opened with VS .NET 2003. On the left side in the Field Explorer - there are seveal categories - Database Fields -...
6
by: G. Stoynev | last post by:
I can't seem to be able to prevent a Crystal Reports formula to evaluate an expression when the report contains no records to show. Here's the formula (DateTransferred is a DateTime column): ...
1
by: annemariearmour | last post by:
I am using Crystal reports version 11.2 to create reports. The data source is SQL Server, and I am using views rather than reporting directly from tables. I apply selection criteria to the incoming...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.