Round With Neg Will Not Work In Query, Why?
Sep 22, 2005
In a query I have placed functions that work fine. Now I needed to round a currency number to the nearest $10. ex. 224.49 would be 220.00. I used round(xxxxxxx,-2). this gives me an error. positive 2 works fine. What's the deal? thanks for anyone who can help me. :)
View Replies
ADVERTISEMENT
Apr 17, 2006
I track reports in a database. I have a date field [Approval_Date] in the database table. I want to review the reports after they have been approved for 6 months to see if the actions fixed the problem, so I created a query based on the table and used the code "6-Month Review Date: [Approval_Date]+180". This works great except that our meetings are always on Wednesday. So, is there a way to modify my code so that it calculates the 6-Month Review Date as 180 days after the Approval_Date, but then rounds up to the next Wednesday?
I really appreciate the help.
Thanks,
Jim
View 9 Replies
View Related
Mar 27, 2014
I have an expression that sets an AI Buy It Now value that is 125% of AI Value and rounds it, which follows AI Buy It Now: Round(([AI Value]*1.25)/10)*10
I need to add to this expression that I only want this calculation applied if AI Values are greater than 999. But I can't figure out how to add this stipulation to the above expression. I have tried IIF but it is not working.
View 5 Replies
View Related
Feb 20, 2015
I'm trying to get a query to perform a calculation and round the results.
The fields that I am running the calculation and am trying to round are Data Type Number, properties Field size Single and decimal places Auto.
I have tried the built in function described in Allen Browne's site to no avail.
[URL]
I have tried rounding the individual fields and then adding result.
I have also tried rounding the result (as attached).
View 11 Replies
View Related
Sep 15, 2014
I have a table of standard Circuit Breaker (CB) sizes. I then calculate a minimum CB size in a query field. I want to use that calculated minimum value to look up the next largest CB size from the table and fill a field in the query with it.
For now, I am going to add a field to the CB size table with the smallest size CB which would be assigned that standard value. I will then use a Dlookup with conditions of greater than "smallest size" and less than "standard size" fields from the CB size table.
I think this will work fine, but there must be a better way.
View 12 Replies
View Related
Feb 22, 2005
What sum can I use to round down on a report
View 1 Replies
View Related
Jan 22, 2008
Hi,
I am running a query that has this function
MyRoundedValue: Round([Bonus Total],2)
I am trying to round up the value in Bonus Total.
Currently the result shows 5140.602 and I want it to round up and show 5140.61
Is this possible? For the life of me I cannot figure it out..
Thanks
Fen How
View 1 Replies
View Related
Dec 30, 2005
Hi,
Need a little help with rounding up. In A2K I have a form with a textbox that displays a security deposit. Security deposit is calculated by rounding the payment to the next $25 increment, hence a payment of 324.53 should have a security deposity of $325.00, but a payment of $325.01 should have a security deposit of $350.00. The code I am using for a datasource for txtSecurity deposit usually works correctly, but for this payment ($324.53) it rounds to $350.00. Here is the code..
=(([txtPayment]25)*25+[txtSecDepRndTo])
txtSecDepRndTo holds the $25 incremental value.
Incidentally, if the payment is $324.49 my code rounds the Security Deposit to $325.00 as it should.
Any help would be greatly appreciated.
View 3 Replies
View Related
Aug 23, 2005
I have a field within a table entitled "Name Display" This displays names in the format:
Surname,forename
I have used the following:
Full Name: Right([Name_Display],Len([Name_Display])-InStr([Name_Display]," ")) & " " & Left([Name_Display],InStr([Name_Display]," ")-1)
To rearrange so format is displayed as forename,surname
However my output with some fields appears as:
SARAH WAILES, with spaces inbetween.
Can anyone suggest a way of removing these spaces?
Thanks
View 1 Replies
View Related
Jan 6, 2006
Hi, I have this query and I would like to have the avg display with only 2 decimal points. This is my SQL and I think I have to use this code but I'm not sure.
FORMAT(CountOfStudent Attended,'.00')
If I ad this after the SELECT statement my query will not work. What am I doing wrong?
Thanks!
~D
This works
SELECT [Attendance for Avg].CRN, Avg([Attendance for Avg].[CountOfStudent Attended])
AS [AvgOfCountOfStudent Attended]
FROM [Attendance for Avg]
GROUP BY [Attendance for Avg].CRN;
View 3 Replies
View Related
Nov 8, 2007
Please help me with the round function. I want .5 to round to 1.
Here is an example of my data: (18+18+18+20)/4 = 18.5 rounds to 18. I want it to round to 19.
I used the following expression:
RoundACT Composite Score: Round((([Column1]+[Column2]+[Column3]+[Column4])/4),0)
Thank you.
View 6 Replies
View Related
Oct 4, 2006
I have values for example like, 0.03, 1.14, 1.28 I'd like to round them to the nearest tenth. So resulting values will be as follows:
0.03 = 0.00
1.14 = 1.10
1.28 = 1.30
How do i achieve this? What's the formula?
View 10 Replies
View Related
Sep 8, 2004
Hi
I've happily been working with my new switchboard only to find it tells me I am limited to 8 entries. How does one get round this - create switchboards which link to switchboards, different pages of switchboard...I've got a bit lost and would much aprreciate any advice.
Thanks
View 5 Replies
View Related
Nov 9, 2004
Yes i have a round fuction on one of my calulations as it was displaying 32.222229 instead of 32.3
so i did this.
im varSumXCPIC
varSumXCPIC=Round(RS("SumXCPIC"),2)
if (varSumXCPIC = "" or isnull(varSumXCPIC)) then
varSumXCPIC = "0.0"
end if
But now when i veiw the page with the value = 0.0 it give me Invalid use of Null: 'Round'
any help on how to get ride of that erro would be great. thanks
View 1 Replies
View Related
Aug 4, 2015
I have is rounding down dates in Access. I seem to be having trouble with the equation I built below:
Months Remaining: IIf(Date()<[Anniversary],Round(DateDiff("m",Date(),[Anniversary],Round(DateDiff("m",Date(),[Anniversary]+12)))))
My goal with this formula is to produce a number of months remaining (rounding down) by subtracting today's date from the anniversary date. The Round function I put in there seems to not work as the result is the same when I remove it.
Another thing I am also trying to accomplish is having the date pushed forward if todays date is greater than the anniversary date. In this instance, I tried adding 12 months to get it back on track. So say the anniversary date is july 4th 2015 and todays date is aug 4th 2015, well thats gonna show negative 1 but if I add 12 it should bring it to 11 months remaining -which would make sense because the anniversary month and day is fixed but the years just get pushed.
View 6 Replies
View Related
Apr 1, 2014
Problem: I want to "round" (to 2 decimal places) numbers 1-5 down and 6-9 up. For example:
1.915 = 1.91
1.916 = 1.92
I know this is completely screwy but I have to match numbers up to a purchasing system that seems to be doing just that.
I've researched rounding in Access a lot and I understand Bankers rounding (that won't work), I understand Int() and Fix() both don't do what I need. I've something about rounding half down (which is what I think I need) or Floor which I don't quite understand.
View 14 Replies
View Related
Feb 13, 2014
How can a I round to the nearest 10 cents
e.g
10.04 = 10.00
10.06 = 10.10
10.28 = 10.30 ........
View 2 Replies
View Related
Feb 27, 2006
We are creating a simple database to maintain driver license information for faculty, staff, and students who use cars from the university’s motor pool.
To do this, I have created two tables: tblDRIVER and tblLICENSE.
The fields in tblDRIVER are:
pkfDriverIndex
strLastName
strFirstName
strInitial
strAddress1
strAddress2
strCity
strState
strZIP
datBirthDate
The fields in tblLICENSE are:
pkfUpdateIndex
fkfDriverIndex
datDateUpdated
strState
strLicNumber
datExpirationDate
ynViolations
ynActive
Information about the driver is stored in tblDRIVER and the driver’s license information is stored in tblLICENSE. Periodically, we run a report that identifies drivers whose licenses are due to expire within a certain number of days. All this works fine.
My problem is that I am trying to create a lookup form that will load from a data entry form that will permit the Motor Pool Clerk to look up a driver by name and review the licensing information (which appears as a subform).
All this sort of works- I am using a combo box (based on a query) to look up a driver’s last name (which it does) and to populate all the driver’s information on the look-up form (including license information in a subform). Currently, the combo box locates the driver (including the unique index, last, and first names), and populates the form with first and last name but the rest of the information is not displayed on the look up form. Worse still, sometimes one driver’s last name matches up with the first name of the next driver listed in the table! This seems to happen only if a look up is attempted more than once. What gives.
Thanks for the help.
View 9 Replies
View Related
Jun 25, 2013
I have a report and I am trying to Round Up the calculated field SumOfAccrual Amount to 2 decimal places. I am attaching a screenshot of my report and output.
View 2 Replies
View Related
Oct 10, 2014
I know the Round function exists in MSAccess, but what I need is one that will always round up, and never round down!
Easy enough in Excel, but I can't find one in Access?
View 2 Replies
View Related
Mar 20, 2015
On one of my Access forms, a specific textbox rounds a value down if the user enters the decimal. The table field bound to it, is a long integer as to not accept decimal values.
For example = user entered .5 rounds to 0
user entered 10.5 round to 10
I would like this to behave in the opposite manner and always round up, but how??? Since users are estimating their hours for specific tasks, I would prefer any decimal value to round to the next integer. I have tried many adjustments to get this working to no avail. I did come across something about key press for decimal and to disallow user to even enter a decimal in this textbox. I would be fine with that solution as well, but could not implement as seen.
View 7 Replies
View Related
Apr 23, 2014
I am increasing prices and after increasing I am left with 4 decimal places and am trying to figure out how to run an UPDATE query to round down prices to the nearest 5 cents, examples below:
42.4516 round to $42.45
42.4659 round to $42.45
42.4489 round to $42.40
2.49 round to $2.45
2.46 round to $2.45
2.44 round to $2.40
2.04 round to $2
I am using "Currency" format.
View 10 Replies
View Related
Oct 27, 2006
A few years ago, I wrote an application in Access 2000 that worked fine. Last year I upgraded to Access 2003. Everything works the same, but the UCase, Left and Right text functions give error messages when used in queries. Anyone have a way to fix this?::confused:
View 2 Replies
View Related
Aug 1, 2007
hi
i have a DB which tracks order numbers,
the main table is a SQL table linked in, and there are lots of local tables as well, one of which is called userDetails and contains a field useremail
i want to open a form and only show records from trackermaindata that contain my useremail -
SELECT dbo_TrackerMainData.userEmail
FROM dbo_TrackerMainData, userDetails
WHERE dbo_TrackerMainData.userEmail=userDetails.useremai l;
when i double click this query in access it works and it shows me only my records, but when i try and run this query from a button (using a macro) in my form, it asks me to Enter Parameter Value userDetails.useremail
i've tried lots and lots of things so far and nothing works. i have lots of other queries which do work, but they don't reference another table - they either contain a static value or take their data from an entry box.
can anyone give any reason why this should not work? it seems straight forward enough!!
thanks for any help
View 4 Replies
View Related
Oct 3, 2007
Hi
I have set up a form to run a query, setting the following VBA to pick up values from the combo boxes in the form. The only problem is that I cant seem to get this working. When i press the command button it won't even get past the Dim db As Database line.
Private Sub Command10_Click()
On Error GoTo Errorhandler
Dim db As Database
Dim qd As QueryDef
Dim vWhere As Variant
Set db = CurrentDb()
On Error Resume Next
db.QueryDefs.Delete "qry_email2"
On Error GoTo 0
vWhere = Null
vWhere = vWhere & " AND [Status]=" + Me.cbostatustype
vWhere = vWhere & " AND [Substatus]=" + Me.cboSubstatus
vWhere = vWhere & " AND [PublicationName]=" + Me.cboPub1
vWhere = vWhere & " AND [PublicationName]=" + Me.cboPub2
vWhere = vWhere & " AND [PublicationName]=" + Me.cboPub3
If Nz(vWhere, "") = "" Then
MsgBox "There are no search criteria selected." & vbCrLf & vbCrLf & _
"Search Cancelled.", vbInformation, "Search Canceled."
Else
Set qd = db.CreateQueryDef("qry_email2", "SELECT * FROM tblgeneralcontactdetails WHERE " & _
Mid(vWhere, 6))
db.Close
Set db = Nothing
DoCmd.OpenQuery "qry_email2", acViewNormal, acReadOnly
Me.Command10.Requery
End Sub
help! I am now proper stuck with this.
Thanks in advance
Shapman
View 5 Replies
View Related
Nov 29, 2007
Im trying to add fields together in a query (these fields are results churned out by an iif expression), however access just concatenates the fields instead of summing. Access will not allow me to change the format of the original fields either.
Any ideas?
View 3 Replies
View Related