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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Formula Help 1

Status
Not open for further replies.

JBourne77

IS-IT--Management
Jan 21, 2008
153
US


Code:
"10" & LEFT({Data.GL Number} & SPACE(25),25) & LEFT({Data.Debit Amount} & SPACE(12),12) & LEFT({Data.Credit Amount} & SPACE(12),12)

Right now, my {Data.Debit Amount} and {Data.Credit Amount} are formatted incorrect and I sure could use some help, as I have a difficult client needing this yesterday. Right now, its coming out like this:

Code:
1002.1973.08PP             $0.00       $90.00

I need it to not print the "$", the decimal and if zero, just be blank, not reported as a 0.00

Any help is deeply appreciated.
 
Hi,
Can you explain why you are concatenating these ?

Are the Debit and Credit amount fields actually strings and not numbers? Why LEFT ?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Turkbear,

Its for a flat file report and when I tried them as RIGHT, nothing showed.

Are the Debit and Credit amount fields actually strings and not numbers? - I don't know the answer to this one. How can I tell - they may be, due to how the SQL was done.
 
When I show the field type on the Debit and Credit fields, they show up as Currency.
 
Code:
WhilePrintingRecords;
Local StringVar D_Amount;
Local StringVar C_Amount;
If ({Data.Debit Amount}= 0) then
    D_Amount := Space(12)
Else
    D_Amount := Mid(CStr({Data.Debit Amount}) & Space(12),2,12);
If ({Data.Credit Amount}= 0) then
    D_Amount := Space(12)
Else
    D_Amount := Mid(CStr({Data.Credit Amount}) & Space(12),2,12);

"10" & LEFT({Data.GL Number} & SPACE(25),25) & D_Amount & C_Amount

I tried using the above code and I still see my decimal and comma. I additionally do not see my Debit's in my report.

In my original attempt, I pulled them both in as:

LEFT({Data.Debit Amount} & SPACE(12),12)

LEFT({Data.Credit Amount} & SPACE(12),12)

Can someone help me get the commas and decimal out and look over my coding?
 
Try:

"10" & LEFT({Data.GL Number} & SPACE(25),25) & LEFT(totext(tonumber({Data.Debit Amount}),0,"") & SPACE(12),12) & LEFT(totext(tonumber({Data.Credit Amount}),0,"") & SPACE(12),12)

-LB
 
lbass -

This is the closest I've come and I changed from Lefts to Right as I read the spec's alittle wrong. Can you help me eliminate the 0 (zero) output this is creating?

Code:
"10" & LEFT({Data.GL Number} & SPACE(25),25) & RIGHT(SPACE(12) & totext(tonumber({Data.Debit Amount}*100),0,""),12) & RIGHT(SPACE(12) & totext(tonumber({Data.Credit Amount}*100),0,""),12)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top