Solved

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

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

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…
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 tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 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

13 Experts available now in Live!

Get 1:1 Help Now