Diff Expresions Should Give Same Result But Don't!
Sep 22, 2006
I've got a table in which there are 20 numeric columns. For one report, I want to add all of the data in those columns together. I used the expression:
Seats: Sum(DailyActivity!PkgSeq01Cnt+DailyActivity!PkgSeq 02Cnt+DailyActivity!PkgSeq03Cnt+DailyActivity!PkgS eq04Cnt+DailyActivity!PkgSeq05Cnt+DailyActivity!Pk gSeq06Cnt+DailyActivity!PkgSeq07Cnt+DailyActivity! PkgSeq08Cnt+DailyActivity!PkgSeq09Cnt+DailyActivit y!PkgSeq10Cnt+DailyActivity!PkgSeq11Cnt+DailyActiv ity!PkgSeq12Cnt+DailyActivity!PkgSeq13Cnt+DailyAct ivity!PkgSeq14Cnt+DailyActivity!PkgSeq15Cnt+DailyA ctivity!PkgSeq16Cnt+DailyActivity!PkgSeq17Cnt+Dail yActivity!PkgSeq18Cnt+DailyActivity!PkgSeq19Cnt+Da ilyActivity!PkgSeq20Cnt)
Where dailyactivity is the name of the table, and pkgseq01cnt is the name of the first column, etc.
The expression returns the number 961.
If i make a query where i sum all of the columns individually, and then a query based off of that query where i add all of the sumed columns together, i get the number 965. (which, as far as i can tell, is the right number)
the expression in the second of those querries is:
Seats: Sum([seat]![SumOfPkgSeq01Cnt]+[seat]![SumOfPkgSeq02Cnt]+[seat]![SumOfPkgSeq03Cnt]+[seat]![SumOfPkgSeq04Cnt]+[seat]![SumOfPkgSeq05Cnt]+[seat]![SumOfPkgSeq06Cnt]+[seat]![SumOfPkgSeq07Cnt]+[seat]![SumOfPkgSeq08Cnt]+[seat]![SumOfPkgSeq09Cnt]+[seat]![SumOfPkgSeq10Cnt]+[seat]![SumOfPkgSeq11Cnt]+[seat]![SumOfPkgSeq12Cnt]+[seat]![SumOfPkgSeq13Cnt]+[seat]![SumOfPkgSeq14Cnt]+[seat]![SumOfPkgSeq15Cnt]+[seat]![SumOfPkgSeq16Cnt]+[seat]![SumOfPkgSeq17Cnt]+[seat]![SumOfPkgSeq18Cnt]+[seat]![SumOfPkgSeq19Cnt]+[seat]![SumOfPkgSeq20Cnt])
where 'seat' is the name of the first query that sums the columns.
I think those two ways should both come up with the same number - but i can't figure out why the first way is missing four! there are thousands of rows so it is hard to go through the table itself. Also, in both of those ways, the querry includes a 'where' column which limits it to rows where another column equals a certain word - but that's relatively straight forward - dont' know why that would make it different.
any ideas?
Thanks! It's driving me crazy!
View Replies
ADVERTISEMENT
Mar 5, 2014
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.
View 1 Replies
View Related
Aug 18, 2013
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'm using access 2003.
View 4 Replies
View Related
Jan 29, 2008
hi all
im looking at doing a query to check records for absense
the 1st will be checking if the person has been absense for 4 weeks (28days) so i will have to check from absense date to today does that equal or greater than 28 days but lesss than 91 days (13 weeks) and is the return to work date blank
is that possible???
View 6 Replies
View Related
Nov 7, 2005
Hello,
I have a form on which I have places a textbox named txtDOB which stored a date of birth.
I have then another text box which has the following function:
=DateDiff("yyyy",[txtDOB],Now())+Int(Format(Now(),"mmdd")<Format([txtDOB],"mmdd"))
Is there a way I can show the age + months?
Thanks.
View 5 Replies
View Related
May 5, 2005
hello, i have checked out the forum for pevious Q's to this problem and found the below.
http://www.access-programmers.co.uk/forums/showthread.php?t=80692&highlight=compare+tables
only problem is thats its writen at a bit too technicle a level from where i am. i've done some investigation into the problem though.
found out i need to use the docmd.transferdatabase function to import the tables i need to compare into my current db.
my question is this. how does it import them, does it create new tables within the current db or is it put somewhere in temp memory for use only while db is open, not sure how it would work. ideally i would like it to import tables, do the table comparison then create a report of the differences or make a new table showing the differences, then it reverts back to how it was before i imported it. i.e. he current databse is unchanged except for maybe a new report or new table (the results).
thank you for any advice.
Neil
View 1 Replies
View Related
Mar 19, 2008
Hello,
I am having problems creating a Exp to show the difference in time.
I am currently using :Expr1:DateDiff("n",[TimeReported],[TimeDefectGiven]) which is returning a figure in decimal.
If the answer was to be 90 minutes i need it to return the figure as 1.50 instead.
I have looked on the site using Date Diff and Time without success
Any help given would be great
View 3 Replies
View Related
Jun 7, 2005
How do I make a query that shows me the differences between two tables with relation to the fields.
View 1 Replies
View Related
Aug 21, 2007
hi everyone, i have a table of timeseies data and would like to run a query working out the difference between the current row's value (day) and a previous row (day, or days before) and put this difference in a new column in the resulting query.
I know it would be straight forward in Excel to run a formula between 2 different rows, but this table has >1 million records and are appended with new records regularly.
Any help or inspiration would be greatly appreciated!
View 14 Replies
View Related
Sep 18, 2007
I have a date field, I am trying to have my query only pull the records that have a date entry that is within and up to 90 days from today or Now. For this query all other records are irrelevant.
THis is what I have found so far
=(Abs(DateDiff("y",Now(),[ls_Exp Date])))
Can someone show me how to add the 90 days in there?
Thanks.
Fen How
View 3 Replies
View Related
Oct 11, 2007
I'm using the date diff .... DateDiff("h",[Start time],[End time]) in a query and then I report the results in a report. I have run into a problem for the first time. I had a start time of 7:00pm, and an end time of 7:00am. This was calculated in the query as (-12) which is messing up my cost formula.
How do I resolve this?
Jerry
View 3 Replies
View Related
Apr 27, 2006
Here we go:
My overall goal is to find out a worker’s downtime (count of weeks between assignments)
I have a qry_Downtime that pull in a worker and his current and future assignment. Each assignment is associate with a start and end date.
Here is how the results look:
Employee (joe schmo)ProjectONE ProjectONEStartDateProjectONEEndDate
Employee (joe schmo)ProjectTWO ProjectTWOStartDateProjectTWOEndDate
Employee (joe schmo)ProjectTHREE ProjectTHREEStartDateProjectTHREEEndDate
Employee (joe schmo)ProjectFOUR ProjectFOURStartDateProjectFOUREndDate
Downtime would be defined the diff in weeks between ProjectONEEndDate and ProjectTWOStartDate, ProjectTWOEndDate and ProjectTHREEStartDate, etc.
Any suggestions.
T
View 5 Replies
View Related
Jun 14, 2006
Friends,
I have a problem with a date diff calculation:
On my form I have placed two controls, a text box and a check box.
The textbox contains is a date field (mm/dd/yyyy).
What I need is a code that checks the checkbox if the date in the textbox is within the last 12 months.
This is the code I am using but not working:
If DateDiff("yyyy", textbox, Now()) >= 1 Then
Me.check1 = "yes"
End If
Any help? Thanks.
View 11 Replies
View Related
Oct 12, 2013
I there is no result in query, I need the default result zero in my form field. I only use query wizard to create queries.
View 5 Replies
View Related
Jan 23, 2008
Hi I have two fields one which represents the time participants went to sleep, one when they woke up however I dont have any dates - it refers to what they do usually. Is it possible to minus sleeptime from waketime to determine duration of time in bed without dates? Or do I assign dummy dates to use date diff function?
View 4 Replies
View Related
Apr 30, 2008
hi
i have a database to manage utility bill payment , it consist of
- Bills :
- billID
- Benificiary Name
-Cost Center
- Bills Transaction :
-TransID
-bILLid
-BillDate
-BillAmount
-Payment Transactions :
-PayTranID
-bILLid
-PayAmount
-PayDate
-BankRef
i made a union query from Bills Transaction and Payment Transactions to calculate bills balances which is : billid,sum(Bills Transaction.BillAmount)-sum(Payment Transactions.PayAmount)
all is working well , but the problem is i cannot find any relation between billtransaction
and billpayment ( per bill ) , cause i wish to payment details for each single bill transaction
the normal case is : bills issued as monthly basis but may fully or partially pay as the following cases :
- each bill transaction may fully pay one time
- in some cases : each bill transaction may fully pay but in multi settle
- multi bill transaction (per BILLID) may fully pay one time
IN CONCLUSION : each bill transaction should be stteled fully within one or two or maximum 3 months , say bill balance for each bILLID shall be zero.
how i could find a relation between this two transaction ( bills and payment ) to preview
payment information for each single bill transaction
exapmle :
billID : 39
BILL Transaction BillPayment BillsBalance
Bill Date - Amount PayDate- Amount
jan08 - 1000 1-1-2008 1000 0
feb08 -1200 5-2-2008 800 400
15-2-2008 400 0
mar08 1900 1900
apr08 1100 30-04-2008 3000 0
may08 1200 05-05-2008 900 300
jun08 1300 30-06-2008 1600 0
View 13 Replies
View Related
Dec 6, 2005
I need to know how to set up a form with three tabs, all of which having the same text boxes or method of data input. I want each tab to write the information input into different rows on my table corresponding to the tab (the tabs will correspond the the first column on the table). I have three rows on my table for three companies. I want a form that has a method of gathering the data for each company and writing that data to the corresponding row. I can set up the form with three tabs, all requesting the same info, but I don't know how to connect them to the corresponding rows.
View 10 Replies
View Related
Jan 4, 2005
Does anyone know/how my forms' background colors are different from one computer to another? The computers that are showing the correct color are both XP and Access 2002 (one is a laptop and one is a desktop)... but then someone else.. on a laptop (with XP and access 2002).. the forms' background colors are not good (purple)... vs. blue on my laptop and the desktop. Thanks!
View 3 Replies
View Related
Oct 17, 2013
I am having a problem with a datediff expression.I have a query that pulls the first date and the last date out of a list but are put in seperate fields. I thought I could build an expression for datediff to calculate the number of dates between them. I can't just put in the dates because they are constently changing.The expression I have is:
[datediff("d",[min/max edging unit #2]![firstofupdate/time by month],[min/max edging unit #2]![lastofupdate/time by month])]
View 4 Replies
View Related
Apr 21, 2006
Is it possible in Access to create one input form that includes fields from different tables.
I want to create a single form that dispenses input fields to separate tables, I don't see anything to make this happen. I know you can retrieve data from separate tables utilizing querys. But is it possible to input data into a single form to multiple tables ?
View 2 Replies
View Related
Mar 29, 2006
v sorry for the basic question, but ive been banging away at access and i cant my head around this..
i need to run a simple query. the query/ search will ask users to enter in the number of a document. i want, when this code is entered, for 2 controls on the form be updated with codes that are stored in a table based on the code they searched for originally.
heres my table structure...
Table A
Doc ID (PK)
Doc No (manually input and is the search item that users enter)
Table B
Unique ID (PK)
Doc No (FK)
Info (to populate field 1)
Info (to populate field 2)
how do i perform this in the query section? do i need to manually code the SQL required, or is this query basic enough that i can just select the fields required in the design view of the query?
thanks guys
View 1 Replies
View Related
Feb 18, 2006
I have via macro that displays the main interface to my database; frmMain (Maximize). This form frmSelectUIC (Minimize) allows me to select a department number of the data imported for analysis.
All is fine, as shown here;
http://members.cox.net/mustang31859/access/before.gif
However, after opening then closing any report the frmMain no longer is displayed as before.
http://members.cox.net/mustang31859/access/after.gif
Why the shift?
Gunner....:confused:
View 2 Replies
View Related
Aug 18, 2005
Afternoon Folks,
I have a database that multiple users have access to.
We all have new pcs of exactly the same spec.
We all have the same oracle ODBC, which is linking to tables in an oracle database on a Sun F15k Server.
The linked tables are set-up using my oracle account with saved password.
We are using the same network.
We are all using Access 97.
Queries that are run in this database are returning results in just a couple of seconds for other users, and 20-30 seconds for me.
Can anyone suggest any factors that may be causing this discrepancy?
Or things that I can run/do to improve performance?
Cheers in advance, James
View 14 Replies
View Related
Dec 21, 2006
I couldn't find a similar question already answered and I am stuck at home due to the blizzard here in Denver Colorado so I can't get any other resources to help. I am working on a select query where I am using two table's and another select query to pull information.
query HOLDINGS HASH QUERY #3:
- AS_OF_DATE
- SAP
- ACCNTNUM
- SumOfSumOfAS_OF_BOOK_VALUE_4TH
table HOLDINGS HASH CGAAP ADJUSTMENT TABLE:
- BEGIN DATE
- END DATE
- SAP
- ACCNTNUM
- SUM VALUE
table SAP DETAIL TABLE:
- Fiscal Year
- Company Code
- Account Number
- SumofAmt CoCd currency
- Cabinet
Currently the join properties include: from SAP DETAIL TABLE the Company Code and Account Number to the HOLDINGS HASH QUERY #3 SAP and ACCNTNUM, from HOLDINGS HASH QUERY #3 SAP and ACCNTNUM to the HOLDINGS HASH CGAAP ADJUSTMENT TABLE SAP and ACCNTNUM.
There are three things that I am trying to accomplish with this query. The first is pulling down the SAP and ACCNTNUM fields which works fine. The second is pulling down the SumOfAmt CoCd currency and SumOfSumOfAS_OF_BOOK_VALUE_4TH which matches the SAP and ACCNTNUM fields which works fine.
What I'm trying to do for the third is to only pull the SUM VALUE from the HOLDINGS HASH CGAAP ADJUSTMENT TABLE that matches the SAP and ACCNTNUM fields and also where the AS_OF_DATE from the HOLDINGS HASH QUERY #3 is between the BEGIN DATE and END DATE from the HOLDINGS HASH CGAAP ADJUSTMENT TABLE.
This query will then be the output for a report.
In order to accomplish the third task I have tried to complete a SELECT statement and a IIF statement that have not worked. I am sure the select statement would work but I just can't figure it out. Any help would be very very much appreciated.
Sam
View 2 Replies
View Related
Aug 7, 2014
I'm using the following function to calculate date diff in network days (excluding weekends)
Public Function NetWorkdays(dteStart As Date, dteEnd As Date) As Integer
Dim intGrossDays As Integer
Dim dteCurrDate As Date
Dim i As Integer
intGrossDays = DateDiff("d", dteStart, dteEnd)
NetWorkdays = 0
[Code] ....
So when using this function in a query to get number of networkdays between 2 date columns ...it works fine but throws a #Error where there is blank entries in either of 2 date columns...
I need to find a way to display Null instead of #Error...
I have tried this expression but no luck...
IIf(IsError(NetWorkdays([Date1],[Date2])),"",NetWorkdays([Date1],[Date2]))
View 7 Replies
View Related
Sep 6, 2006
Hi Guys, Ive been struggling to create a query, I wonder if anyone knew how to do this.
I have data setup basically like this: -
Code Customer
A CustA
A CustB
B CustC
C CustD
D CustH
D CustI
E CustE
F CustF
G CustG
Is there a way i can make a count work to show like this: -
Code ID Customer
A 1 CustA
A 2 CustB
B 1 CustC
C 1 CustD
D 1 CustH
D 2 CustI
E 1 CustE
F 1 CustF
G 1 CustG
So if there is more than one customer, the ID will accumulate until the code changes so it will revert back to one again.
Hope someone knows how to do this.
Thanks
Predator002
View 2 Replies
View Related