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!

Converting DataTypes in an Unbound Field.

Status
Not open for further replies.

kcville

MIS
Nov 18, 2003
2
GB
Hello

I am having some problems and would appreciate if somebody could help me.

I have two fields, one is an integer and one is currency.

I have an unbound field and have set the format to reflect that of currency.

In my formula I have the following:

WhileReadingRecords;
If {sp_reportdealer;1.UnitsIncome} = "Units" then
{sp_reportdealer;1.IntStandard Acquire}
Else
CDbl({sp_reportdealer;1.curStandard Acquire})

This sets the datatype of my unbound field to Number but still enables me to output curStandard Acquire as currency, but also outputs IntStandard Acquire as currency, which I actually need to be a Integer.

I would really appreciate any help on this.

Many thanks

Kelly
 
Why does it matter? If it is the display of decimal places, then you can use Totext({sp_reportdealer;1.IntStandard Acquire}, 0) and Totext(CDbl({sp_reportdealer;1.curStandard Acquire}), 2).

I think that Crystal insists on a field being one distinct data type, not the data type you choose to use on that occasion.

What you could also do is to have two overlaping fields, using tests to ensure that only one of them shows anything for a given line.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top