?
Solved

trimming and concenating two fields with CR 10

Posted on 2007-07-25
5
Medium Priority
?
286 Views
Last Modified: 2008-02-01
Using Crystal 10, I am trying to take 2 number fields, each 8 characters long, and trim 4 extra 0's off the right side, then concenate them together with a hyphen between to form an account number string. Example:
field 1: 21000000
field 2: 0210000
resultant field: 2100-021
0
Comment
Question by:wiseman4250
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:crgary_tx
ID: 19567014
write a formula:

{table.field1}[1 to len({table.field})-4}+'-'+{table.field2}[1 to len({table.field})-4}

Gary
0
 
LVL 13

Expert Comment

by:crgary_tx
ID: 19567026
rather this

{table.field1}[1 to (len({table.field})-4)}+'-'+{table.field2}[1 to (len({table.field})-4)}

Gary
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 19567697
If they are truly 8 characters (your example isn't)

Left({table.field1},4) & "-" & Left({table.field2},4)

If they can be variable length then gary's formula or if you prefer

Left({table.field1},Length({table.field1}-4) & "-" & Left({table.field2},length({table.field2}-4)

mlmcc
0
 

Author Comment

by:wiseman4250
ID: 19581569
thanks for the help.  I had trouble with syntax errors on the first two options.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 19582487
Glad i could help

mlmcc
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

569 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