I have a simple column to hold phone numbers. It is an nvarchar(20) to allow for standard phone numbers with extensions.
The first 14 digits will be a standard US phone number. The column allows NULL values and I want to format the data to the following:
(999) 999-9999. This is being done with an expression as follows:
The first 14 digits will be a standard US phone number. The column allows NULL values and I want to format the data to the following:
(999) 999-9999. This is being done with an expression as follows:
="(" + Fields.PrimaryPhone.SubString(0,3) + ") " + Fields.PrimaryPhone.SubString(3,3) + "-" + Fields.PrimaryPhone.SubString(6)
The issue we are having is if a value is NULL, the expression errors out. I have tried an IIF function, but it does not fix the error condition. Here is the error we are receiving:
An error has occured while processing TextBox 'primaryPhoneDataTextBox':
Object reference not set to an instance of an object.
We have tried a conditional format prior to the expression, and that has not worked either...
Need some assistance as to how to do this...
Thanks...