Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining fields, formatting simultaneously

Status
Not open for further replies.

Drus

Technical User
Jan 29, 2002
43
US
I have combined 5 fields by simply inserting a "+" in between each field. This works fine, but I need to insert some formatting to remove/add some digits in there. The bank needs a file to read 37 characters long in a given format. There are two fields that need formatting within the formula. They are...

(1) Need to convert a date field from this format 09/30/02 to this format 20020930.

(2) Need to convert a number field from this format 1,182.97 to this format 0000118297. It must always be 10 digits long. And it must be filled with leading zeroes prior to the amount.

Here is an example of a desired result:
128000247C000011829720020930012350184

Here is where I am with my existing formula:
{PR_02DirectDepDataEntry.RoutingTransitNumber}+{PR_02DirectDepDataEntry.AcctType}+totext({PR6_PayrollDataEntryHeader.DirectDepAmount})
+ totext(CurrentDate)+totext({PR_04DirectDepBankCode.BankAcctNumber})


Here is the result of my above formula:
128000247C1,182.9709/30/200212350184

The only two problem areas are in brackets below:
128000247C [1,182.97] [09/30/2002] 12350184
Andrew Hagenbach
OPUS SYSTEMS, INC.
916.503.3173
ahagenbach@opus-sys.com
 
Try:

{PR_02DirectDepDataEntry.RoutingTransitNumber}+

{PR_02DirectDepDataEntry.AcctType}+

replicatestring( "0",10-length(totext(({PR6_PayrollDataEntryHeader.DirectDepAmount}*100),0,"")) )+
totext(({PR6_PayrollDataEntryHeader.DirectDepAmount}*100),0,"")+

totext(CurrentDate,"yyyyMMdd")+

totext({PR_04DirectDepBankCode.BankAcctNumber})

-k kai@informeddatadecisions.com
 
Hi !

I was just writing something similar, but with another way to get the amount.

ToText({PR6_PayrollDataEntryHeader.DirectDepAmount} * 100, "0000000000") +
totext(CurrentDate,"yyyyMMdd")+

/Goran
 
You guys are awesome. Andrew Hagenbach
OPUS SYSTEMS, INC.
916.503.3173
ahagenbach@opus-sys.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top