Queries :: Equation For Comparing Three Quantities
Aug 6, 2014
I have three sources of data which all equate to a reconciliation of the same data e.g. the same record of a stock holding is held on three separate systems, which must all be the same.
I am trying to build a an equation in a query field, which compares each quantity:
Qty Diff: [Dealer Qty]-[Pulse Qty]-[SWFAL Qty].
If the quantities are all the same, then I want to return a Zero. If one or more of them are different, I want that difference to show. Variance of the above equation that would do it?
View Replies
ADVERTISEMENT
Sep 30, 2014
I have a transactions table which records a qty number (- or +) and references particular location details (location, room, rack, shelf etc). My question is how do I sum the qty for the same product at different locations. So my user sees that product A has a qty of X in location C and qty Y in location D. I can sum the transactions table qty which does give me a sum based on a single location but each location has multiple racks, shelves etc. I need to know the sum of transactions for the same product for exactly the same location, room rack etc
View 3 Replies
View Related
Nov 30, 2005
I have a form built from a table and in a specific cell I need an equation but can't figure it out yet. I have several different fields and I need 2 fields divided to get the result. i.e. Total_Actuals divided by SA_CDI_Money = MoneyPercentage. Any ideas how I can get this to work?
View 4 Replies
View Related
Oct 14, 2014
I'm currently working on a project that calls for a graph that is based on an equation which the users can change while in the database.
the equation is basically an annual compound interest formula: 65*(1+x)^([YearNumber]-1), where x is the rate of change as a decimal, and what the users can change.
I've tried to use a simple query with this equation as one of the expressions, where the x is displayed as [Rate as decimal], but when I do this, I get an error on the table: the database engine does not recognize [Rate as Decimal] as a valid field name or expression.
I've also tried tying the equation to an unbound text box on a form called "RateasDecimal", with a button that opens the form with the graph on it, but I get the same error - except [Rate as Decimal] is replaced with "forms!form1!RateasDecimal".
is it possible to create a graph like this in access.
View 2 Replies
View Related
Mar 24, 2006
I want to compare two queries as follows: Select all the records in query1 where the value in fieldA does NOT also appear in any record in fieldA of query2. Is there an easy way to do this using the query tools or will this require a vba function?
View 3 Replies
View Related
Nov 8, 2004
I have 2 tables. Quotation Details and Order Details. As you fill in the Order details Form I wish to compare fields from the
Quotation Details Table. Is this possible? Please advise.
Thank you.
View 1 Replies
View Related
Sep 16, 2013
As a Access newbie I am looking into a problem that I hope to solve structurally and "transparently" via Access in stead of Excel.
I would like to compare two similar tables for different months. I am looking for:
+ loan id's that are new in table(t), i.e. not exist in table(t-1)
+ loan id's that exited: that is exist in table(t-1) and not in table(t)
+ loan id's that stayed in both
How do I solve this in the easiest way?
View 4 Replies
View Related
Aug 27, 2013
I have one table A that has a Name field that I would like to find if it matches any of the cases in table B with 2 other fields: Field 1 or Field 2
There is no way of establishing referential integrity because the Name Field can be found in either Field 1 or Field 2.
How would I go about searching so I can pull in the rest of the data that I need with when the Name is matched either with Field 1 or 2?
View 2 Replies
View Related
Mar 11, 2014
Trying to Compare 2 fields Status with answers Yes or No, from 2 Tables PipeLine and Pipe, and get the fields that don't match, what am i doing wrong?
SELECT PipeLine.[Project Name], PipeLine.[Capacity DC], PipeLine.[Project Num], PipeLine.[Status]
FROM PipeLine LEFT JOIN Pipe ON PipeLine.[Project Name] = Pipe.[Project Name]
WHERE (((Pipe.[Status]) ="Yes");
View 1 Replies
View Related
Nov 23, 2013
I have run into some problems by comparing two lists. My project is to compare two lists and on the below listed criteria's and with the wanted results.
Criteria's:
1. Part
2. Colour
3. pcs.
Wanted results:
1. Equal match (same part, Colour and pcs (pcs difference above and equal 0)
2. Equal match (same part, colour but missing pcs. (pcs difference below 0)
3. Missing parts (difference in org. list - 1 and 2 query)
But already in the first part I run into problems. I do a query as below. (picture attached)
SQL code:
SELECT Parts_All.[Lego part], Parts_All.farve, Parts_All.Antal, [Set 7897-1].[Lego part], [Set 7897-1].farve, [Set 7897-1].Antal, [Parts_All]![Antal]-[Set 7897-1]![Antal] AS Part_Diff
FROM Parts_All RIGHT JOIN [Set 7897-1] ON Parts_All.[Lego part] = [Set 7897-1].[Lego part]
GROUP BY Parts_All.[Lego part], Parts_All.farve, Parts_All.Antal, [Set 7897-1].[Lego part], [Set 7897-1].farve, [Set 7897-1].Antal
HAVING (((Parts_All.[Lego part]) Like [All_parts]![Lego part]) AND ((Parts_All.farve) Like [Set 7897-1]![farve]) AND (([Parts_All]![Antal]-[Set 7897-1]![Antal])>=0));
This query is returning 2 of the same lines with part and colour but with different pcs. Why.?
View 7 Replies
View Related
Aug 9, 2013
I need to identify pairs of records by their ID and date fields, then compare their number values to get a text result.
I have a query that has the following fields
AuthInstanceID, ConsumerID, AuthNumberID, AuthStart, AuthEnd, PSRUnits, BSTUnits.
Sample data is below (PSRChange and BSTChange are fields I want to self populate based on the comparison I'm trying to do)
AuthInstanceID....ConsumerID....AuthNumberID....Au thStart....AuthEnd....PSRUnits....BSTUnits - PSRChange -BSTChange
1374006036.........356679..........20255102....... ....4/22/13.......7/21/13....0.............416~~~~-Loss~~~~~-None
-432536491.........356679...........20255102....... ...1/21/13.......4/21/13....104..........416~~~~-Loss~~~~~-Loss
-124970517.........356679...........20147863....... ...10/23/12.....1/20/13....208..........520~~~~-None~~~~~-Null
504564357...........469432..........20254788...... ....4/22/13.......7/21/13....0.............520~~~~-None~~~~~-None
282523535...........469432..........20254788...... ....1/21/13.......4/21/13....0.............520~~~~-None~~~~~-Gain
356661326...........469432..........20254788...... ....11/20/12......1/20/13....0.............416~~~~-None~~~~~-Null
What I need to do is compare these records in the following fashion:
Identify pairs of records where ConsumerID is the same AND AuthStart dates are successive. Then compare PSRUnits of more recent record (by AuthStart) with the previous record (by AuthStart) and determine the change of PSRUnits between them. If change is positive, "Gain" in field PSRChange, "Loss" for a loss, "None" for no change, and "Null" if there is an error due to no previous record to compare with. Do the same with BSTUnits/BSTChange
I've tried adding the following fields, but this did not work
PrevEnd: (Select Max(AuthEnd) from tblAuthorizations Where AuthEnd < Auths.[AuthStart])
PrevBST: DLookUp("[BSTUnits]","tblAuthorizations","AuthEnd=" & [PrevEnd] And "ConsumerID=" & [ConsumerID])
View 14 Replies
View Related
Jul 10, 2013
I have a table [VL] with four fields, [vl_id], [product], [vl_date], [valeur_liquidative].
The idea of the table is that you can input and update the value of each product on a given day.
I need to find the difference in days between successive dates (vl_date) each time that a product value (valeur_liquidative) is updated. Values aren't updated everyday as it is not updated during the weekends. I have had a go at this but have struggled..
A picture of what the table looks like is attached for reference.
View 9 Replies
View Related
Apr 17, 2013
I have 2 tables one Access, one FoxPro both containing similar information. The idea of my query is to compare both tables and update the Access table if the value in the FoxPro table has changed. This works fine for a number of similar queries that I have. However, intermittently, this query will see two values as different when they are exactly the same and replace the value in the Access table with a seemingly random value. I know the "Random" values are from other records within the table but cannot see any link between the values.
View 2 Replies
View Related
Oct 9, 2013
I have a table which is used to record electric billing period dates, total kWh and costs for a list of locations each month. I would like to compare the quarter total kWh and costs for this year "2013" against same quarter last year "2012". I have created two queries, the 1st is capturing data from 2013 and the 2nd is capturing data from 2012. I created a 3rd query which joins the 1st and 2nd together by month where fields match. Both tables have the same fields, however there is more records in 2012 than 2013. How can I join the tables together so months that have no data are left blank?
View 14 Replies
View Related
May 15, 2013
I have one field where string contains several words separated by semicolon and my goal is to be able to remove duplicates within the string and keep only unique values. Here is an example:
initial field:
xxx;yyy;ppp;yyy
targeted result:
xxx;yyy;ppp
How this could be achieved ?
View 5 Replies
View Related
Jul 27, 2005
Greetings to you all
I have been struggling with a problem I thought was simple. However I am unable to solve it. I have searched the forum with no luck.
I have three separate tables that have somewhat similar structures. Each have a Quantity in a specific column that I would like to sum across all three tables. The tables contain hourly values for (say) one week (168 values for each contract type). The table structure is as follows:
T1:
Contract_key1
Effective_Date
Quan1
T2:
Contract_key2
Effective_Date
Quan2
T3:
Unit_key
CC_key
Effective_Date
Quan3
The length of T1 and T2 depends on how many contract types are involved. Table T3 depends on the number of units (Number of rows= 168*No. of contracts(units in T3)).
I would like to write a query (will be in VB eventually) that would give me the Sum(Quan1+Quan2+Quan3) for each hour accross all contracts and units. My output table should have only 168 rows (sum all quantities each hour). In the future I may want to sum for each contract, but currently I only need a single sum for each hour.
If this issue has already been dealt with on this forum please point me in the right direction.
Thanks
rmiller
View 5 Replies
View Related
Mar 21, 2012
Let's say I have a table with information like this:
Number Quantity Date
1 20 XXX
2 12 XXX
2 65 XXX
1 6 XXX
4 13 XXX
5 32 XXX
3 41 XXX
4 22 XXX
Now, Let's say I want a report as shown below..
Number
1 Total= 26
2 Total= 77
3 Total= 41
4 Total= 35
Well, by now I'm sure you get the point. I want it to add all the quantities with their respective numbers and only show the total on the report. How would I do this?
View 2 Replies
View Related
Dec 10, 2013
I have two identical Access tables, for example tblDataYesterday and tblDataToday. The data from tblDataToday has updated data changes in it that are different from tblDataYesterday. I have a maximum of 100 fields to review. I want to compare the two tables and display in a query the differences between the data from both tables.
View 1 Replies
View Related
Jul 8, 2013
I have a table that has a date field set to text. I use the Mid function and get just the month in a query. I have a textbox on a form that when the user adds a month or removes a month from a selected listbox it adds or removes that months number from the textbox.
I want to us that text box on the form as the criteria for the month (the Mid function getting the month) and I can seem to get it to read what's in the textbox and use it as the criteria. I can manually type in a number and it works fine.
View 6 Replies
View Related
Jun 26, 2014
I can not solve this problem, my Access knoledge is mediocre.
I have the following table from imported data:
RecNr IPaddres DateandTime
1 178.00.000.01 20-11-2013 21:47:21
2 178.00.000.01 20-11-2013 21:47:59
3 178.00.000.01 20-11-2013 21:48:35
4 178.00.000.01 22-11-2013 20:44:59
5 178.00.000.02 22-12-2013 19:47:59
6 178.00.000.02 22-12-2013 20:47:59
7 178.00.000.03 01-02-2014 12:47:59
8 178.00.000.03 01-02-2014 12:48:30
9 178.00.000.03 01-03-2014 11:47:59
etc
I want to make a query that results in displaying records that have the same IP-address where the difference in the date/time stamp is within 1 minute. When the date/time stamp is > 1 minute the record can be deleted from the table.
View 6 Replies
View Related
Sep 7, 2007
I have a field, quantity, which i want to add all the quantities together to show a total. I want to do this using a query as i will use this total for other calculations. When in the query, i have selected "sum" in the totals column in the quantity. What do i need to do extra? I am not getting any results at the moment.
Emily
View 2 Replies
View Related
Jan 22, 2007
I used the Northwind database and modified it to suit my needs. This is basically just maintaining inventory, using the "Orders" form and "Orders Subform" to create records in the "Orders" and "Order Details" table which deduct quantities from the "products" table.
Our employees are allowed to use the "Orders" form to issue items from inventory, and this is the method I used for updating quantities in the "Products" table (method 1):
http://support.microsoft.com/kb/252813
Here's the problem: It is entirely possible that a transaction from inventory might be cancelled, and there is no way to replace the inventory levels in the "Products" table, other than doing it manually.
I would prefer a method of maintaining inventory levels in the "Products" table based on current records in the "Order Details" table, whereas, I could merely open the "Order Details" table, delete the canceled transaction (record), and the quantities in the "Products" table would be automatically adjusted.
It doesn't seem like this should be too difficult, I just need a point in the right direction on how it should be done.
Any help will be appreciated.
Thanks,
Mark A.
View 1 Replies
View Related
Jun 30, 2005
Hi
I am creating an invoice which has a subform of the products which the customer may purchase.
So within the invoice itself there is:
ProductID | Product_Name | Quantity | Unit_Cost | Line_Total
I am hoping to have the Product_Name as a drop down of all the products which are available and would like the Unit_Cost to automatically lookup the unit cost of the respective Product.
Could someone please help me as i dont know how to do it, at the moment its a case of the individual having to look at the unit cost within the Product_Name drop down, remember it and then enter it lol
Also, how do I have the Line_Total as a calculated field of the Quantity*Unit_Cost? Do I put it within the Order Details table (which handles the many-to-many) or within a query?
Any help or links directing me to answer would be great
Many thanks in advance
:: CNLIFEASITIS
View 2 Replies
View Related
Jun 10, 2014
I need to run a condition that compares 2 field quantities together based on the same item. If they both equal the same then i want it to run a code and change a property for that record.
I will have a OrderQty and a Total receivedQty when these 2 equal each other then it updates the items Status to Received. What is the best way to accomplish this? in vba or queries/sql?
View 4 Replies
View Related
Nov 2, 2014
I have a form with subform . I want to calculate purchase quantity with criteria of product and quanties before sale date. If i use with specified date it gives correct result.but if i use field address it ignores date criteria
Nz (dsum ("pqty","purchasequery","product=" & [sales.product] & "and clerancedate<=#31/07/2014#"),0)
Nz (dsum ("pqty","purchasequery","product=" & [sales.product] & "and clerancedate<=#" & [forms!salesm!sdate] & "#"),0)
But it is not working
Sdate is date and it is on main form
View 6 Replies
View Related
Sep 9, 2014
I have attached a sample of a database.
Table 1 has all the items I am trying to sell with sell by date after which I cannot sell this item. Then in Table 2 I have forecasted sales. So now I am trying to calculate stock consumption to see if I will be left with any stock that I cannot sell.
So now somehow I need to deduct sales forecast from my stock holding but it needs to go by date i.e. consume all stock for Item 1 with date 16/09 before moving to Item 1 with sale by date 23/09.
So based on the attached example, I can see that on 16/09 I will consume only 5 cases from sell by date 16/09 and another sale is 18/09. So that would give me information that I will be left with 95 items dated 16/09, which I cannot sell because they will be out of date.
Ideally I would like also to include the logic that if Item is out of date it would move to the next sell by date.
So in this case sale of Item 1 forecasted for 18/09 (94) would consume the whole stock (50) with date 23/09 and another 44 from date 01/10
For Item 2 I can see that units with Sell by date 30/09 will be consumed on 25/09 and I will start taking stock from next sell by date which is 14/10.
View 8 Replies
View Related