I have a table with a numeric field named BIRTH. The data is similar to 11005 or 11100. This is 5 or 6 digits.
I want to create a field that will copy the first or 2 first digit from the birth field.
To do this I am using athe following formula in the 'Select query' form.
monthBirth: IIf(Len(Trim$([BIRTH])=5),Mid$(Trim$([BIRTH]),1,1),Mid$(Trim$([BIRTH]),1,2))
This will only retrieve the first digit from the field 'BIRTH'. I would like to retrieve the first digit if Lenght is 5 and the first 2 digits, if the length is 6.
Any help on this, as I am running out of ideas!!
Thanks in advance.
I want to create a field that will copy the first or 2 first digit from the birth field.
To do this I am using athe following formula in the 'Select query' form.
monthBirth: IIf(Len(Trim$([BIRTH])=5),Mid$(Trim$([BIRTH]),1,1),Mid$(Trim$([BIRTH]),1,2))
This will only retrieve the first digit from the field 'BIRTH'. I would like to retrieve the first digit if Lenght is 5 and the first 2 digits, if the length is 6.
Any help on this, as I am running out of ideas!!
Thanks in advance.