Discussion Locked

Problem with MS Access Code

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to get a number as a result of a division in query builder but want to only show the whole number part of the result. The code I am using to do this is:

Wait in Months: Left([KDays]/30.41,(InStr(1,CStr([KDays]/30.41),".")-1))

but I get an invalid procedure call error. Can anyone tell me the correct syntax?

3 replies

by iht4

Use the Round Function

Description
Returns a number rounded to a specified number of decimal places.

Syntax
Round(expression [,numdecimalplaces])

i.e.

Round(Left([KDays]/30.41,(InStr(1,CStr([KDays]/30.41),".")-1)) ,0)

hope this helps
Iain

This discussion is closed to new replies.