I have following values for a varchar column:
36804629891, 083647382718
How to find the length of the values ?
How to check if there is any leading zeroes for the values ?
How to take first 10 digits of the numbers?
Checking leading zeroes.
Moderators: chulett, rschirm, roy
Re: Checking leading zeroes.
1. Len(Column_Name) will give you the length.
2. Do you need to know how may 0's or you need to takeout the 0.
If you want to take out, then you can make the mapped column as Int (You can use the function AsInteger(ColumnName)).
3. Column_Name [1,10] will give you the first 10 char.
DS User
2. Do you need to know how may 0's or you need to takeout the 0.
If you want to take out, then you can make the mapped column as Int (You can use the function AsInteger(ColumnName)).
3. Column_Name [1,10] will give you the first 10 char.
DS User
-
- Participant
- Posts: 31
- Joined: Mon Jun 28, 2010 5:15 am
- Location: pune
If you read the response properly, SURA said 'If you want to take out, then you can make the mapped column as Int (You can use the function AsInteger(ColumnName)). '
Asinteger() will remove the leading zeroes.
This may not be the best method but you can do
Len(Column_Name)-Len(AsInteger(ColumnName)) to find the number of leading Zeroes.
Asinteger() will remove the leading zeroes.
This may not be the best method but you can do
Len(Column_Name)-Len(AsInteger(ColumnName)) to find the number of leading Zeroes.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If there are leading zeroes the first digit in the number will be 0. It is sufficient to test for this.
Code: Select all
Left(InLink.TheNumber,1) = "0"
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.