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

Imput mask without commas

Status
Not open for further replies.

sermac

Programmer
Jul 27, 2002
238
0
0
US
Hi:
How can I clean up a GRIDCOL6 with this control source:

trim(b1b250.a31)+', '+trim(b1b250.a32)+', '+trim b1b250.a33)

A31=street
A32=City
A33=State

When I don't have an "street" I would like to get rid of the commas and replace a31 with "To Be Determined" in the grid even though city state may be availbable.

THX for any feedback.

Bill


 
checkout IIF() function. Here is the help section from ms vfp

Returns one of two values depending on the value of a logical expression.

IIF(lExpression, eExpression1, eExpression2)
Return Values
Character, Numeric, Currency, Date, or DateTime

Parameters
lExpression
Specifies the logical expression that IIF( ) evaluates.
eExpression1, eExpression2
If lExpression evaluates to True (.T.), eExpression1 is returned and eExpression2 is not evaluated. If lExpression evaluates to False (.F.) or null (.NULL.), eExpression2 is returned and eExpression1 is not evaluated.

Nick Patel
 
Here is one solution;

IIF(EMPTY(b1b250.a31), '', TRIM(b1b250.a31) + ', ')+TRIM(b1b250.a32)+', '+TRIM(b1b250.a33)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top