Trim on variable having space as value
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 56
- Joined: Mon Oct 16, 2006 7:32 am
Trim on variable having space as value
I was trying to use trim function on a variable which has spaces . It seems it does not return a null . Any suggestion on the function to be used for the issue , so that it should return a null if the values is spaces
JT
Remeber - an empty string is not a null.
So, trimming a string which has spaces will not return a null - but an empty string - ''
If you need it to return a null, then you would have to explicitly set it to Null based on a condition of the sort -
Make sure that your input field is a Varchar.
So, trimming a string which has spaces will not return a null - but an empty string - ''
If you need it to return a null, then you would have to explicitly set it to Null based on a condition of the sort -
Code: Select all
If trim(input.col)="" then SetNull() else trim(input.col)
-
- Participant
- Posts: 56
- Joined: Mon Oct 16, 2006 7:32 am