Query Calculation Incorrect

Nov 23, 2007

Hi all

I have a query field doing a simple calculation: 874*(18,3/55,65*0,0592)
Access calculates this to: 17,0144948838454
Excel as well as my own calculator gets: 17,0144948787062
All table fields is defined as double.

If anyone can help me with an explanation as to why access doesn't seem to get this simple calculation right, I would be most thankful.

View Replies


ADVERTISEMENT

Why Is This Query Incorrect?

Nov 1, 2005

SELECT [FA Ctr], [SAP Co], [SAP Ctr], [GL Co],
Format (([SAP Co],"0000") AS NewField), (([cst ctr], "0000000000") as costcenterappended) INTO [Interim Table]
FROM Asset_Map;

View 1 Replies View Related

Incorrect Results From Query

Feb 25, 2008

Thought this thing was working great.Seems this is happening:If the sum of credits exceed the sum of charges, the query doubles the sum of charges. The query-SELECT TblCustInfo.CID, TblCustInfo.Name, TblCustInfo.SrvAddr, TblCustInfo.SrvAmt, TblCustInfo.BLCAT, Sum([TblCharges.Chargeamt]) AS SumOfCharges, Sum([TblPayments.Creditamt]) AS SumofCredits, nz([SumOfCharges],0)-nz([SumofCredits],0) AS RunBalance, TblCustInfo.HerbieFROM (TblCustInfo LEFT JOIN TblCharges ON TblCustInfo.CID=TblCharges.CID) LEFT JOIN TblPayments ON TblCustInfo.CID=TblPayments.CIDGROUP BY TblCustInfo.CID, TblCustInfo.Name, TblCustInfo.SrvAddr, TblCustInfo.SrvAmt, TblCustInfo.BLCAT, TblCustInfo.Cancel, TblCustInfo.HerbieHAVING (((TblCustInfo.Cancel)="n"));When I run the query, the SumofCharges calc is the culprit since it shows in that column. I can't dup it in the SumOfCredits, but I would suspect it will also do it somewhere down the line since they are virtually the same.HELP !!!!

View 14 Replies View Related

Queries :: Incorrect Year In Query?

May 19, 2014

i have a query that pulls a read-only SQL table, i have check in that table and the date field is set up as a Date/Time type, however the db was set up with the date and time in the same field. (1/1/2014 9:00:00 AM)

I have set up the SQL code below to pull out just the Date and not the time. however when i enter my criteria on the form, only the correct month and days load, it pulls in all other years with that month/day.

my Access level - on the lower end of medium experienced.

SELECT IIf(InStr([dbo_Rides]![ApptDatetime]," "),Left([dbo_Rides]![ApptDatetime],InStr([dbo_Rides]![ApptDatetime]," "))) AS [Date], IIf(InStr([dbo_Rides]![ApptDatetime]," "),Mid([dbo_Rides]![ApptDatetime],InStr([dbo_Rides]![ApptDatetime]," ")+1)) AS [Time]
FROM dbo_Rides
WHERE (((IIf(InStr([dbo_Rides]![ApptDatetime]," "),Left([dbo_Rides]![ApptDatetime],InStr([dbo_Rides]![ApptDatetime]," ")))) Between [Forms]![frmMain]![subTCTools].[Form]![snavHistory].[Form]![subnDriver]![txtFromDate] And [Forms]![frmMain]![subTCTools].[Form]![snavHistory].[Form]![subnDriver]![txtToDate]));

View 2 Replies View Related

Total Time Query Displays Incorrect Value

Feb 16, 2007

Hi,
I am using

Total_Time: Format([totaltime_mins]/60,"00") & ":" & Format([Totaltime_mins] Mod 60,"00")

To display the time as hours and minutes but this formula doesn't always work correctly.

for instance if the totaltime_mins = 90 then total_time is displayed as 2:30

also if totaltime_mins = 40 then thotal_time is displayed as 1:40

does anybody know why this is not working correctly ?


kind regards,
jamie

View 2 Replies View Related

Queries :: Using Query As DAO Recordset Showing Incorrect Results

Apr 26, 2013

I have a query (that gets it's data from several other queries) with a column called "max." The data in the column is correct, but when I call on the query in VBA, it shows me incorrect data.Here is where I call the query:

Code:

Dim db As DAO.Database, qdf As DAO.QueryDef, rs As DAO.Recordset
Dim strReport As String
Set db = CurrentDb()
Set qdf = db.QueryDefs("7-ErrorsReport")
qdf.Parameters(0) = Forms!frmmain!dt1.Value
qdf.Parameters(1) = Forms!frmmain!dt2.Value
qdf.Parameters(2) = Forms!frmmain!d2.Value

[code]....

The query looks at a table of employees and finds out if they have been issues a warning letter before, then prints out a corresponding report based on the "max" warning level they are at.The problem arises when an employee graduates from a 6 month probation period - all letters in that period should be ignored. As i said, they are ignored correctly when i run and view my query ("7-ErrorsReport") because they are filtered out at that point, but for some reason when this code runs, it somehow sees the previously issued letters which are stored in a table and likely in some of the other queries.

I am not sure if there is some issue with the query tree I have set up which is necessary to get the results I need, or if something is wacked with the was I am using it as a recordsource.

View 3 Replies View Related

Queries :: Parameter Query Returning Incorrect Results Based On Checkbox

Jul 31, 2013

I have a parameter query that contains information on a list of people and contains 3 checkboxes: alumni, parent, business

In this query, I am trying to use parameters to filter the results based on these three fields i.e.

true, false, true would return all records where either alumni, business or both are true, and parent can be either true or false.

false, true, false would return all records where only parent is true, and the other fields do not matter.

View 2 Replies View Related

Queries :: Calculate Moving Average - Make Table Query Type Incorrect

Aug 16, 2015

I found the attached example a while back (can't find the site again though ) and it calculates a moving average. I've hacked out the parts I need for my own work and I can create my moving average query without an issue.

However, I need to extract the MA data into a table so planned on using append. I kept getting type errors so I tried make table to see what type it was creating and it appears to be Short Text rather than a number.

I've added an extra button and Make Table query to the example.

As far as I can tell from the code, the moving average value when calculated is a Single. However, when I write it to the table, its a Short Text.

How do I make the created Table use Number Type for my calculated moving average?

Using Access 2013

View 2 Replies View Related

Incorrect Information

Sep 9, 2005

I have set up 2 queries which are working correctly. The problem is when I try to combine them it brings back incorrect information. The 2 queries that work correctly are set up like this

Query1:
SELECT Projects.[Work Stream], Count(Poles.[New Pole No]) AS [CountOfNew Pole No], Sum(Projects.[Line Length]) AS [SumOfLine Length], Projects.Team
FROM Projects INNER JOIN Poles ON Projects.[Scheme No] = Poles.[Scheme No]
GROUP BY Projects.[Work Stream], Projects.Team
HAVING (((Projects.Team)=[EnterTeam]));

Query2:
SELECT Projects.[Work Stream], Sum([Material Cost]+[Labour Cost]) AS [Total Cost]
FROM Rates INNER JOIN (Projects INNER JOIN [Pole Work Instructions] ON Projects.[Scheme No] = [Pole Work Instructions].[Scheme No]) ON Rates.[Rate No] = [Pole Work Instructions].[Rate No]
GROUP BY Projects.[Work Stream];

Do you have any idea how I can combine these to get accurate results?

View 3 Replies View Related

Incorrect Syntax

Jun 30, 2005

I am getting the following error:

ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/province.asp, line 24

And this is my code please help:

<%
province=Request.Querystring("province")

Dim intRecordsPerPage
Dim intRecordLoopCounter

SET Conn = SERVER.CREATEOBJECT("ADODB.Connection")
Conn.OPEN "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/db/dealers.mdb")
SET RS = SERVER.CREATEOBJECT("ADODB.Recordset")

strSQL = "SELECT * FROM tblDealers WHERE "
strSQL = strSQL & "ProvState = '" & province & "'"
Response.Write strSQL
strSQL = strSQL
RS.OPEN strSQL, Conn, 3, 3

RS.PageSize = intRecordsPerPage

If RS.EOF Then
Response.Write "<CENTER>There are no dealers in this state"
Response.Write "<br>Please check back later<P></CENTER>"
Response.End


Else
Response.WRITE "<CENTER><B>List of Dealers</B><BR>"
Response.WRITE "<BR><HR><BR>"
Response.WRITE "<table valign=top border=1 cellspacing=0>"
Response.WRITE "<TR>"
Response.WRITE "<center><TABLE valign=top border=1 cellspacing=0 BGCOLOR=#DFDCEE>"
Response.WRITE "<TR>"
Response.WRITE "<TH>Company Name</TH><TH>Street Address</TH>"
Response.WRITE "<TH>City</TH><TH>Province</TH><TH>Postal Code</TH>"
Response.WRITE "<TH>Phone Number</TH>"
Response.WRITE "</TR>"
For intRecordLoopCounter = 1 to intRecordsPerPage

If RS.EOF Then Exit For
Response.WRITE "<TR>"
Response.WRITE "<TD WIDTH=200><font size=2>"
Response.WRITE RS("CompanyName")
Response.WRITE "</FONT></TD><TD WIDTH=200><font size=2>"
Response.WRITE RS("StreetAddress")
Response.WRITE "</FONT></TD><TD WIDTH=150><font size=2>"
Response.WRITE RS("CityName")
Response.WRITE "</FONT></TD>"
Response.WRITE "</FONT></TD><TD WIDTH=150><font size=2>"
Response.WRITE RS("ProvState")
Response.WRITE "</FONT></TD><TD WIDTH=150><font size=2>"
Response.WRITE RS("PostalCode")
Response.WRITE "</FONT></TD><TD WIDTH=150><font size=2>"
Response.WRITE RS("PhoneNumber")
Response.WRITE "</FONT></TD></TR>"
RS.MOVENEXT
Next
End If
Response.WRITE "</TABLE></center>"


SET RS = NOTHING
Conn.CLOSE
SET Conn = NOTHING
%>

View 1 Replies View Related

Incorrect Collating Sequence

Oct 27, 2005

I tried this question a few weeks ago, but I'm trying again.

I have 2 Access 2002 files. One has a sort order of ascii and one has a sort order of international. I need them to both have the same sort order. It doesn't matter which one. Right now I get the above error message on one of them.

How can I change the sort order so that I can import Paradox files like I used to?
:eek:

View 11 Replies View Related

Incorrect Record In Table

Nov 22, 2006

Can somebody explain to me, how can happen mistake inside of table like a picture?
1. I don't understand, how can be change automatic number - see the picture
2. Why is there some japanese charakter.

If somebody knows, please tell me.
hurka.deltec@wo.cz

View 1 Replies View Related

Incorrect Result For An Average

Sep 21, 2006

Have searched but could not find my solution. I have a bowling league database and I am doing averages based on games bowled. On certain averages the results are incorrect. Such as

Tot pins = 1169 divided by
tot games = 6

the result should be 194.83

but the result in my query is 196

have tried the Round function, Abs function and cLng function to no avail.

Thank you

View 10 Replies View Related

Form Opening At Incorrect Field??????

Dec 5, 2006

Hello,

This is probably pretty simple but i can't find any info on it on this forum:

Every time i open my form the cursor automatically selects a field halfway down the page. How do i get it to open with the cursor at the first field on the form???

Also, I would like the form to be maximised upon opening anyone know how to do this?

Thanks

View 6 Replies View Related

Forms :: Incorrect Name Of Form Displayed

May 6, 2014

I saved my form with a particular name and I have used that name all throughout my code and it still works fine. But when I open that form, the name I see on the top of the form is not that name at all. It's actually some value I gave a combo box a while ago.

View 2 Replies View Related

Queries :: IIF Condition With Incorrect Result

Dec 11, 2014

I have a POLEFFDATE field with dates in date/time format. A single record has POLEFFDATE equal to 12/15/2013. I calculated a simple field called EVALUATE as follows: IIF([POLEFFDATE]< 1/1/2014,1,0). EVALUATE should equal 1 for this record, but it equals 0. Why ?

View 3 Replies View Related

Record Count After Filtering Is Incorrect?

May 29, 2012

The filter output from a recordset in the following code is 1. But this is incorrect: How can this be corrected?

Private Sub Command43_Click()
Dim curDatabase As Database
Set curDatabase = CurrentDb
Dim rs3 As Recordset
Dim t As Recordset
Set rs3 = curDatabase.OpenRecordset("Select * from [Courses under Programs]")
rs3.Filter = "ProgramCode = 'ANS.CT'"
Set t = rs3.OpenRecordset
t.MoveLast
t.MoveFirst
MsgBox t.OpenRecordset.RecordCount
End Sub

View 2 Replies View Related

Incorrect Field Submission To Table

Jun 3, 2014

I am modifying an inventory database and the first change I made was to split it. The major forms for this is an intake form to enter the inventory and a work sheet to identify the open items to be worked including the fields used to close the items.After the split the intake form started changing a time field. To be clear on this; this is not a calculated field. The person entering the inventory manually enters the time in which the item was recieved. When the record is saved (or rather when the Add New Record button is pushed) the time field gets changed to something seemingly random.

Could this be some kind of conflict due to both forms being bound to the same table and being use simultaneously? These forms would never be used by the same user at the same time. Also, why would this become an issue only after splitting the database?

View 6 Replies View Related

Query Calculation

May 16, 2005

Hello, I have the following criteria for my Query >=0.8*[Projects]![EstimatedHours]. This tells me when we've used 80% of our actual hours. How would I go about the criteria line if I wanted it to return above >= 50% hour use, but below 80%? Thanks

View 1 Replies View Related

Calculation In A Query

Sep 8, 2005

I have a query that is built up of 5 fields with only the 2 below being visible. I am wanting to be able to calculate the total price for each pole no i.e. Pole no 01-02 total price would be £1441.79, What is the best way to do this? Sample data is shown below


New Pole NoTotal Cost
01-02.....£437.08
01-02.....£476.37
01-02.....£36.21
01-02.....£70.27
01-02.....£51.56
01-02.....£370.30
01-1.....£437.08
01-1.....£476.37
01-1.....£36.21
01-10367.....£493.43
01-10367.....£70.15
01-10367.....£76.51
01-10367.....£102.67
01-10367.....£87.54
01-10367.....£36.21
01-10367.....£51.56
01-10367.....£39.54
01-11448.....£437.08
01-11448.....£463.25
01-11448.....£493.43
01-11448.....£476.37
01-11448.....£70.15
01-11448.....£76.51

View 4 Replies View Related

Query Calculation

Dec 6, 2005

In qryAddticket, I am trying to calculate two conditions (see Condition 1 & 2)However, I am having a problem on the first condition because it is adding 8 hours when it shouldn't. Can someone help to either fix my code or write a new one?

Condition 1: If the day_of_wk is 1, calculate time-reg_time/60, If the day_of_wk is 1 and time is less than 0, calculate time-reg_time/60+24

Condition 2: If the day_of_wk is 2, calculate time/60, If the day_of_wk is 2 and time is less than 0, calculate time/60+24

My code: pre: IIf([day_of_wk]="2",[time]/60,IIf([time]<0,([time]-[reg_time])/60+24,([time]-[reg_time])/60))

Thank you very much!

View 2 Replies View Related

Calculation Query

Feb 26, 2007

I need to calculate the total cost of the order and enter this into the "CostOfOrder" field which you can see in the picture...

http://i13.photobucket.com/albums/a298/steve01/untitled2.jpg

I need to read all the orderlines for an order into a record set and calculate the cost for each orderline. I need to use a loop in VBA to add them all together.

Here is the query for inclusion in VBA...

Dim StrSQL As String

StrSQL = "SELECT orderline.qty*sandwich.price"
StrSQL = StrSQL + "FROM sandwich INNER JOIN orderline ON
sandwich.sno=orderline.sno"
StrSQL = StrSQL + "WHERE (((orderline.orderno)="
StrSQL = StrSQL & orderno
StrSQL = StrSQL + "));"

Do Until recordSetData.EOF
Total = Total + recordSetData.Fields(0).Value
recordSetData.MoveNext
Loop

I think the Query is correct, but where do I put this in the form (or where do I actually put it as I don't know!) to make it work?

Thanks in advance!
Steve :)

View 1 Replies View Related

I Need Help With A Calculation Query

Oct 19, 2004

Im building a database for a car dealership. what do i need to do to take how many times someones name comes up in a certain field in a table and show it as a number. I need to include this calculation in a subfrom on a form which displays "employee info" which is already stored. Basically i just need to take how many times there name shows in the salesman field and show it as a number.

thanks

please respond, URGENT!

View 2 Replies View Related

Forms :: IIF Statement Returning Incorrect Value In Subform

Jun 16, 2015

I am trying to sum a column on a subform named Cost of New if another column named Final = any of the values listed in my code. However, it is summing the Cost of New column regardless of the values of Final. It is summing for all values.What do I need to modify to make this correct or should I do it another way?

=IIf([Final]="RPR-RPR & RTN" Or [Final]="NFF-TST & NFF" Or [Final]="RTN-RETURN" Or [Final]="SCL-SCR LOCALLY" Or [Final]="SCR-SCR RETURN" Or [Final]="BER-BER RTN CST",Sum([Cost Of New]),Null)

View 3 Replies View Related

Queries :: GrantID - MAX Function Returns Incorrect Value

Dec 16, 2014

I'm working on a database to track our program's performance under different grants. Services performed for each grant would be entered on a quarterly basis. I am tracking the number completed for each service during the quarterly period.

I want to create a report that shows progress against benchmarks depending on the most recent quarter completed. Rather than fooling with dates, I put a field in the table where the data is entered for the number of the quarter in which the service was performed. The field, 'Quarter', holds numerical values 1-4 corresponding with the quarter. The table holds entries from different projects, distinguished by the field 'GrantID'.

There will be more than one service entered for each GrantID.

I would like to be able to identify the most recent quarter in which services were performed for each GrantID.

I have tried using the MAX function in a query but it seems to be adding "1" to the highest quarter number in the field for each GrantID. The code is:

SELECT DevEntryQ.GrantID, Max(DevEntryQ.Quarter) AS MaxOfQuarter
FROM DevEntryQ
GROUP BY DevEntryQ.GrantID;

With this query, if the highest quarter number entered in the table for GrantID1 is 3, the query returns "4".

In Excel, I would use an array formula: = {MAX(IF(Table1[GrantID]=GrantID, Table1[Quarter])}.

I want to use the most recent quarter to retrieve that quarter's benchmarks and show the progress toward the benchmark rather than the overall progress toward the goal for that grant and service.

View 2 Replies View Related

General :: Date Is Incorrect In Report View

Jul 6, 2015

So I have to text boxes, one for month and one for year. Below is the control source for each box. When I go into Report View, I get January 1905....This is definitely NOT January 1905....I've checked the date on my clock, it says today's date...

=Format(Month(Now()),"mmmm")
=Format(Year(Now()),"yyyy")

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved