Access SQL: trimming data

  • Thread starter Thread starter Pharoh
  • Start date Start date
P

Pharoh

If one column in a table has a value of 23:45.99 how can I cut off
everything after the decimal if it's greater than .00?
 
Pharoh

If you actually had a number, you could convert it to an integer to get rid
of everything to the right of the decimal place. But "23:45.99" is a text
string.

If you are using it as a number, Access doesn't know that. You may have to
"parse" it and convert it to an actual number before you can truncate (or
round, or ...) it.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
As Jeff points out, 23:45.99 is a string, not a number, so you can use
string functions on it:

Left("23:45.99", InStr("23:45.99", ".") - 1)
 

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

Back
Top