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
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...
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.
Summary: This is an Access db to track leave slips. To enter new time we have a form with a combo box, choose a name in the combo box, then a subform shows that employee's info from our timeoff table, and lets...
Summary: hi! i wanted to know how to add expressions in access. like if there is a field 'quantity' and it has numbers. what i want is that when the quantity goes less than 3 it shud generate message abt that....
Summary: I have a combo box that is automatically filled with a list of client names when the form is opened. The only probem is, the text of the combo box (what you see before you drop it down) is always bla...