Computing.Net > Forums > Office Software > Rounding in Access

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Rounding in Access

Reply to Message Icon

Name: Tautitan
Date: February 7, 2005 at 05:56:38 Pacific
OS: Win 2000
CPU/Ram: N/A
Comment:

I am trying to round down a number in a query using Microsoft Access. The number is displaying an age. The number of years is displayed fine but it has numbers after the decimal point. I would like to know how to get rid of these numbers by rounding the number down to the nearest integer. The following is the expression i am using:

Age: ROUND((Date()-[Date of Birth])/365.25,0)

Unfortunately this only rounds to the nearest integer so it is no good for finding out someones age.

Any help on this matter would be greatly appreciated...

Matt



Sponsored Link
Ads by Google

Response Number 1
Name: Jennifer SUMN
Date: February 7, 2005 at 06:47:46 Pacific
Reply:

Have you tried using ROUNDDOWN instead of ROUND?


0

Response Number 2
Name: Tautitan
Date: February 7, 2005 at 06:59:47 Pacific
Reply:

ROUNDDOWN is not used in queries in access as ROUND is the only one used.

Are you talking about using VBA script to build an expression? As i have no previous experience in using it.

Matt


0

Response Number 3
Name: mdow
Date: February 7, 2005 at 07:54:02 Pacific
Reply:

SELECT Int((YourValueHere)/1)* 1 AS Floor;

You can change the 1 to a different multiple.
--Mike


0

Response Number 4
Name: tau_titan
Date: February 7, 2005 at 09:51:58 Pacific
Reply:

Thanks for the reply Mike but what is "your value here" in reference to and where do i use it? i tried puttig the age field in there but it did not work:

RoundedYear: SELECT Int(([Age])/1)* 1 AS Floor

Have probably got this hopelessly wrong

Matt


0

Response Number 5
Name: mdow
Date: February 7, 2005 at 13:49:10 Pacific
Reply:

Put the same thing you used above in your query except omit the Round function.

You can use the statement I wrote above to test your values in a query by itself. To enter in in your query just use something like this

RoundedYear:Int((YourValueHere)/1)* 1

Replace YourValueHere with your age calculation/formula.

I usually edit queries in SQL view, but you can edit in design view just as well.

--Mike


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Rounding in Access

OLE error in Access 2003 www.computing.net/answers/office/ole-error-in-access-2003/2169.html

help needed in access www.computing.net/answers/office/help-needed-in-access/1391.html

Combo Box in Access www.computing.net/answers/office/combo-box-in-access/3477.html