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!

If field is Null 1

Status
Not open for further replies.

jlr123

Technical User
Feb 24, 2014
117
US
If a field is null, I want to replace it with "In Transit" else the field. I have tried various syntax to no avail. The "In Transit" does not appear in the report for blank warehouse city.


I have Default Values For Nulls selected
Formula below:
if isnull({IM_Warehouse.WarehouseCity})then "In Transit" else {IM_Warehouse.WarehouseCity}

Can you please assist? Thanks very much.
 
Are you certain that the field is null?
You can change the formula to account for spaces/blanks that are not null like this:
if isnull({IM_Warehouse.WarehouseCity})OR TRIM({IM_Warehouse.WarehouseCity})="" then "In Transit" else {IM_Warehouse.WarehouseCity}
 
Thank you so much. I used the OR TRIM syntax and it works.
 
I have also used the len(textfield) = 0 to check for NULL (got that from someone else). Sometimes a text string from the DB is not evaluated as NULL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top