Solved

Crystal Reports - Combining a two Number Field to display or to make "one field"

Posted on 2007-12-04
2
229 Views
Last Modified: 2010-04-21
I have a crystal report for which I want to combine two "number" type fields into one.
The first field is the account field and the second field is the sub accont field, I want to make these into one field and also to be able to use selection criteria and to be able to group based on this new field.

The account field is something like say for Cash 1010
The sub account field would be something like say 100

I want this new field to give me something like 1010-100
and after created to be able to group by this and select certain combinations etc...
0
Comment
Question by:gemontes
2 Comments
 
LVL 28

Accepted Solution

by:
bdreed35 earned 125 total points
ID: 20404747
You can create a formula to combine them:

//@AccountCombination
totext({table.account},0,"") & "-" & totext({table.subaccount},0,"")

This assumes that the account and sub account are already the number of digits that they need to be.
If you need them to be in this format XXXX-XXX, you can alter the formula to this:

totext({table.account},"0000") & "-" & totext({table.subaccount},"000")

You can group on this formula, so that covers that.
As far as selection criteria, you can reference the formula and apply critieria to it, but performance will be affected as that criteria will not be passed down to the database and will be filtered on the client machine.  It will still work, but could cause your report to be slower.
I would recommend that you either filter for the account and sub account seperately, or you create a SQL Command to join the fields together for selection criteria purposes.
0
 

Author Closing Comment

by:gemontes
ID: 31412628
WORKED PERFECTLY - THANKS
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now