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

Matching a Number and String Field

Status
Not open for further replies.

enbw

Technical User
Mar 13, 2003
296
Hi,

I am writing a report based on a 3rd part product. I have two fields in different tables, one defined as a string and one defined as a number. I need to be able to match these up in the select expert. Is there anyway to do this?

Thanks in advance
 
Hi

you have to convert one of them to sring or number

create a formula for this
@vonvert

totext({your_field})

cheers



pgtek
 
You have options.

The most efficient would be to create a SL Expression out of one of the fields:

//create a number from a string:
cast(table.field as numeric)

//create a string from a number:
cast(table.field as varchar(32))

The above is database and Crystal version dependent, not sharing this information will limit responses.

Or within Crystal you would create a formula (Insert->Field Object) and place something like:

//create a number from a string:
val(table.field)

//create a string from a number:
totext(table.field,0,"")

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top