Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2007-12-04
2
Medium Priority
?
237 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 500 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

927 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