Solved

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

Posted on 2007-12-04
2
234 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
[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 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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. …
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

627 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