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

Need help concatenating 1

Status
Not open for further replies.

Lucieann

Technical User
Aug 29, 2003
35
US
I am trying to combine two fields into one, but separate them with a -. For example, 111-3. I have tried the following formula, but I get an error when I try to save it:

{Test_3.Category}+"-"+{Test_3.SubNumber}

I get an error that says "A number, currency amount, date, time, or date-time is required here." The bold area above is where the error is. Both of the fields I am trying to combine are numeric fields.

Any help would be greatly appreciated!!
 
try the following:

totext({Test_3.Category},0) + "-" +
totext({Test_3.SubNumber},0)
 
That worked like a charm! Thank you so much!!

How would I handle doing the same thing, but with date fields? I tried the code above, which worked, but the dates were in the wrong format.
 

For dates, the formula will be ToText({table.date_field},"MM/dd/yyyy")

Remember to use an uppercase M for month, as lowercase m refers to minutes.

For additional conditions related to the ToText field, check out the help screen in Crystal. It has all the conditional fields listed as well as examples of proper use.
 
Using Test_3.Category}&"-"&{Test_3.SubNumber} is another way to do it - only you have no control on how to format the numbers/currencies

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top