Never Hide
Registered User.
- Local time
- Today, 22:14
- Joined
- Dec 22, 2011
- Messages
- 96
Hello guys,
I have a problem with a query I wanna write. I have a field in a table(text field)
which is like this
Field
====
ABC-1
ABC-15
ABC-6
note: it's just 1 column.
What'd I'd like to do is check the number after the "-" and if it's 1digit change it to the same but with a Zeoro (0) in front of him and change the "-" to " - ". So the example will change to
Field
====
ABC - 01
ABC - 15
ABC - 06
If've created a select query first to test and this what I used for a test field is this
P.S. the "ABC"s i used are just random,the length of the "ABC" isn't always the same for every row in the table
I have a problem with a query I wanna write. I have a field in a table(text field)
which is like this
Field
====
ABC-1
ABC-15
ABC-6
note: it's just 1 column.
What'd I'd like to do is check the number after the "-" and if it's 1digit change it to the same but with a Zeoro (0) in front of him and change the "-" to " - ". So the example will change to
Field
====
ABC - 01
ABC - 15
ABC - 06
If've created a select query first to test and this what I used for a test field is this
Code:
test: IIf(Len(Right([tblTest];InStr([tblTest];"-")-1))=1;Left([tblTest];InStr([tblTest];"-")-1)+" - "+replace([tblTest];Right([tblTest];InStr([tblTest];"-")-1);"0"+Right([tblTest];1));[tblTest])
P.S. the "ABC"s i used are just random,the length of the "ABC" isn't always the same for every row in the table