Rounding down in access

stevey03

New Member
Joined
Nov 28, 2003
Messages
25
Hi

I'm trying to get and update query that will round a value down to the lower integer. The value is calculated using the datedif function:

Datediff(y,dateofbirth,now())

I want it to return the value in years to give an age, but as a whole number. Is there any type of round function that anyone knows of that could do this or any type of complex formula? I'm using Access 2000 with Windows XP.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Does that expression not actually return a whole number?

BTW the syntax should be Datediff("yyyy",dateofbirth,now())

According to help "y" returns the day of year, whatever that is.

EDIT

Are you using this as part of another expression?

eg Age:Datediff("y",dateofbirth,now())/365.25

If you are you could use something like this to get the whole number:

Age:Int(Datediff("y",dateofbirth,now())/365.25)
 
Upvote 0
Ok that kind of helps. My syntax was wrong, I just need to figure out the rounding down part. I was thinkin of sticking that within an IIf query. I'll give that a go and let you know how i get on.
 
Upvote 0

Forum statistics

Threads
1,221,848
Messages
6,162,415
Members
451,762
Latest member
Brainsanquine

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top