VT555
VT555

Reputation: 91

Truncate Double in Access

I'm using the DateDiff() function to calculate an age.

Dim a As Double
a = DateDiff("d", Me.Age, Me.ApptDate) / 365

I want to get the truncated value and NOT the rounded value.

I just want the whole number - No decimals.

How can I do this?

Upvotes: 1

Views: 991

Answers (1)

Linger
Linger

Reputation: 15058

I do believe you are after the INT() function:

Dim a As Double
a = Int(DateDiff("d", Me.Age, Me.ApptDate) / 365)

Or have you tried doing the following:

Dim a As Integer
a = DateDiff("d", Me.Age, Me.ApptDate) / 365

Upvotes: 2

Related Questions