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.
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?
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 ?
Code: SELECT Avg(Round([Final 205].[LastOfSumOfRehLOS],2)) AS AvgInpLOS, Avg(Round([LastOfSumOfWaitLOS],1)) AS AvgWaitTime, Count([Final 205].PHN) AS Observations, [Final 205].LastOfIntensity AS Intensity_Level FROM [Final 205] GROUP BY [Final 205].LastOfIntensity;
It doesn't found the result to two decimal places.
I am working with Access 2010, on vista. What I have is a query made up of two tables, one product the other inventory. (see below) query.jpg
In the product table i have a field called "minimum reorder level". In the inventory table i have two fields one called "number in stock" and "number on order". What i want to happen is "number on order" to be filtered by the result, if the "number in stock", is less than "minimum reorder level", if it is, have the result placed in the "number on order" field. EG. if the "number in stock" = 2 and the "minimum reorder level" = 5 then 3 would be placed in the field "number on order" and only the second record from the query would be visible (see below) Query result.jpg The result of this would mean that the field "number on order" would be populated with the result and the and query would also use this to filter the record.
I want to add a number to my results within a query depending on the month and how many results. For example I have 10 results in my query 3 from January, 5 from March and the rest from April. The 3 from January would be 1,2,3. The five in March would be 1,2,3,4,5 and so on. Is it possible to do?
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?
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;
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:
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
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.
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 !!!!
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?
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.
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]));
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
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?
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)
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.
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...
Using Access 2010. I have a form on which I've placed a simple label. I try to set the label border color to black but it shows grey. I can set the border color to #000000 and it's grey. I set it to #000001 and it shows black as expected.
I'm thinking it has something to do with the themes, but shouldn't an exact color code show as expected? As a new member (<10 posts) I can't post an actual link, but here's the text of the location: [URL] ....