Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning all.
Quick question for you all. Am I able to check the exact length of a field in a table like this? If not, can someone suggest a better way.
Thanks
Thom
if (len([finalCalledPartyNumber] = 11),
Num(Right([finalCalledPartyNumber] ,10)),'0000000000') as [Final Called Number],
if (len([finalCalledPartyNumber] = 4),
Num(Right([finalCalledPartyNumber] ,4)),'0000') as [Final VoIP Called Number],
if (len([finalCalledPartyNumber] = 3),
Num(Right([finalCalledPartyNumber],3)),'000') as [Final Common Called Number],
Hi Thom,
U can use the following script.
if (len([finalCalledPartyNumber] )= 11,
Num(Right([finalCalledPartyNumber] ,10)),'0000000000') as [Final Called Number],
if (len([finalCalledPartyNumber] )= 4,
Num(Right([finalCalledPartyNumber] ,4)),'0000') as [Final VoIP Called Number],
if (len([finalCalledPartyNumber] ) = 3,
Num(Right([finalCalledPartyNumber],3)),'000') as [Final Common Called Number],
or
if (len(trim([finalCalledPartyNumber] ))= 11,
Num(Right([finalCalledPartyNumber] ,10)),'0000000000') as [Final Called Number],
if (len(trim([finalCalledPartyNumber] ))= 4,
Num(Right([finalCalledPartyNumber] ,4)),'0000') as [Final VoIP Called Number],
if (len(trim([finalCalledPartyNumber] )) = 3,
Num(Right([finalCalledPartyNumber],3)),'000') as [Final Common Called Number],
the TRIM function removes the white spaces from ur field values.
Regards
Manesh
Thanks Manesh,
In your opinion which one is better to use?
Thom
Hi Thom,
The use of above is as per situation, If u dont want to count spaces(Left and write not inbetween words) in fiels then use second one, else use first one. But secondone in more efficient then first one.