Parsing a field value

G

Guest

I have a field value = "1.99" and I am looking for a formula that will allow
me separate the ".99" for placement in a separate field. Can anyone help me
here?
 
R

Rick Brandt

Mike Dixon said:
I have a field value = "1.99" and I am looking for a formula that will allow
me separate the ".99" for placement in a separate field. Can anyone help me
here?

Fix([FieldName])

Should give you the value to the left of the decimal point. For the value to
the right of the decimal you can use...

[FieldName] - Fix([FieldName])
 
P

peregenem

Rick said:
I have a field value = "1.99" and I am looking for a formula that will allow
me separate the ".99" for placement in a separate field. Can anyone help me
here?

Fix([FieldName])

Should give you the value to the left of the decimal point. For the value to
the right of the decimal you can use...

[FieldName] - Fix([FieldName])

For me, this returns 0.99 cast as a FLOAT (Double). The OP has implied
the data is text e.g.

SELECT 0.99 AS test_text,
IIF(INSTR(1, test_text, '.') = 0,
'',
MID$(test_text, INSTR(1, test_text, '.'))
) AS test_text_parsed
 

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