Solved

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

Posted on 2007-12-04
2
233 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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