count decimal places in text string

G

Guest

have a quandry....am looking thru Text Functions but not coming up with a
solution.

In a text string (part number codes) I need to be able to identify those
with 3 digits to the left of a decimal point . .

001.23
1.234
11.23
ABC.123

so in this case the first and the 4th would qualify

I have the ability to do multiple query steps if needed or even a makeTable
if that would be necessary.... but am struggling with the function that will
find those with 3 digits to the left of decimal point.

Advice most definitely welcomed....tia
 
G

Guest

A grateful thanks; plugged it in and now each record with 3 digits to the
left of the . returns a -1. And from there I can do the rest.

I previously had looked at Mid at MS's site:
http://msdn2.microsoft.com/en-us/library/Aa445073(VS.60).aspx

But its sample is just this:
Syntax
Mid(string, start[, length])

So I don't fully understand your ="."

or why it is counting left rather than right............if you have a moment
for further explanation it is welcomed...thanks again
--
NTC


Duane Hookom said:
Use:
Mid([Part Number Codes],4,1) ="."

--
Duane Hookom
Microsoft Access MVP


NetworkTrade said:
have a quandry....am looking thru Text Functions but not coming up with a
solution.

In a text string (part number codes) I need to be able to identify those
with 3 digits to the left of a decimal point . .

001.23
1.234
11.23
ABC.123

so in this case the first and the 4th would qualify

I have the ability to do multiple query steps if needed or even a makeTable
if that would be necessary.... but am struggling with the function that will
find those with 3 digits to the left of decimal point.

Advice most definitely welcomed....tia
 
G

Guest

Counts 4 spaces from 1st character; if = “.†Then returns -1 otherwise
returns a 0
--
NTC


Duane Hookom said:
Use:
Mid([Part Number Codes],4,1) ="."

--
Duane Hookom
Microsoft Access MVP


NetworkTrade said:
have a quandry....am looking thru Text Functions but not coming up with a
solution.

In a text string (part number codes) I need to be able to identify those
with 3 digits to the left of a decimal point . .

001.23
1.234
11.23
ABC.123

so in this case the first and the 4th would qualify

I have the ability to do multiple query steps if needed or even a makeTable
if that would be necessary.... but am struggling with the function that will
find those with 3 digits to the left of decimal point.

Advice most definitely welcomed....tia
 
G

Guest

You can open any module window in Access and search Help for Mid Function.
There is a fairly good example in there (ver 2003)
--
Duane Hookom
Microsoft Access MVP


NetworkTrade said:
A grateful thanks; plugged it in and now each record with 3 digits to the
left of the . returns a -1. And from there I can do the rest.

I previously had looked at Mid at MS's site:
http://msdn2.microsoft.com/en-us/library/Aa445073(VS.60).aspx

But its sample is just this:
Syntax
Mid(string, start[, length])

So I don't fully understand your ="."

or why it is counting left rather than right............if you have a moment
for further explanation it is welcomed...thanks again
--
NTC


Duane Hookom said:
Use:
Mid([Part Number Codes],4,1) ="."

--
Duane Hookom
Microsoft Access MVP


NetworkTrade said:
have a quandry....am looking thru Text Functions but not coming up with a
solution.

In a text string (part number codes) I need to be able to identify those
with 3 digits to the left of a decimal point . .

001.23
1.234
11.23
ABC.123

so in this case the first and the 4th would qualify

I have the ability to do multiple query steps if needed or even a makeTable
if that would be necessary.... but am struggling with the function that will
find those with 3 digits to the left of decimal point.

Advice most definitely welcomed....tia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top