473,394 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to count values from different records/data set.

Hi there,

i got a question on how to plus/minus 2 values from the same column but from different records.

how can i add the value "A" and the value "B" via queries or table (if that is possible)?
Attached Images
File Type: jpg access question.JPG (22.5 KB, 146 views)
Oct 31 '16 #1
5 800
PhilOfWalton
1,430 Expert 1GB
How are you defining A & B?

Phil
Oct 31 '16 #2
hi Phil,

basically i want to create another column to calculate the differences from first records to the 5/6 records.

For example assuming its minus from 1st record and the 5th record,
NAMES AGE DIF
Alex 56 25
Aaron 23 16
Bryron 14 26
Brian 35 45
Chole 25 etc
Colt 16 etc
Eric 26 etc
John 45 etc

I hope this helps. :)
Nov 1 '16 #3
PhilOfWalton
1,430 Expert 1GB
Sorry, not at all.
You must define which records are needed for your calculation.
Are you saying that you always use record No 1 (Alex) in your example and then want the differences in age between Alex and everyone else? That's not what your example shows.

Are you manually inserting a flag against 2 records and asking for the difference in age, if so, by the time you've selected the two records concerned, you could have worked it out in your head.

So back to the original question. I need a strictly defined rule of which records (people) whose age difference is required.

Phil
Nov 1 '16 #4
Hi Phil,

I apologies for not being clear. I am not sure what you mean by defined rule.

would it help if i told you that i wanted the value of age at record 1 to minus the value of age record 5, it goes for example,
1. rec 1 - rec 5
2. rec 2 - rec 6
3. rec 3 - rec 7
4. etc..

would this help? otherwise, could you give me an example on what you mean by defined rule? i am not a knowledgeable ms access user. just a basic user.
Nov 1 '16 #5
PhilOfWalton
1,430 Expert 1GB
So are you saying the required records are ALWAYS 4 records apart? - That would be an example of a rule.

However in your JPG example, the selected records are 6 apart, so I don't think we're there yet.

Obviously, I am not being clear either. Ignoring databases, when comparing two "things" you must have a way of accurately defining which "things" you want to compare.

Same applies to a database. When you want to compare two records, you must have a method of defining which records.
For example you could use two Combo Boxes, one to select each person. Very tedious, but it could be done.

In your JPG example what made you choose Aaron & John? How do you want to indicate to the program that those were the selected records?

Phil
Nov 1 '16 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Nick | last post by:
Hi, I believe a dataset keeps a record of the original values of all rows before AcceptChanges() is called. Then how can I retrieve the original values? What function call do I use? Thanks!
0
by: John Baker | last post by:
Hi: On forms, at the top of the screen menu, there is an entry records/data entry, which i wish to replicate in a macro or code. I would also like to be able to revert to normal mode. Can...
3
by: Zb Bornemann | last post by:
Hi All, Ok. Here's what my table looks like: Field1 Field2 Field3 Field4... Record1 1 3 2 9 Record2 9 1 9 ...
2
by: Greg Strong | last post by:
Hello All, Is there a simpler way to count text boxes with data in them when the 4 text boxes are in the header of a form? I've written the code below and it works. ,----- | Private Sub...
2
by: Viviana R via AccessMonster.com | last post by:
I'm tryin to calculate de difference of time between different records and fields. I have a Report with date, time In, and Time Out fields. EX: Date Time IN Time Out 4/12/05 12:10...
59
by: tdb | last post by:
I am trying to calculate the session time for logon and logoff datetime fields, but the fields are in different records and different columns. Is this possible with a subquery? Here's a sample of the...
2
by: ilikebirds | last post by:
Access 2003: I notice that on a form there is a menu for RECORDS - Data Entry. What occurs here is when data is updated and the option is selected It enters the data into the table and starts...
3
by: geraldjr30 | last post by:
hi, i have the following, which lists days of the week, and records associated with each of them from an MS Access table. i would like to know how to display the count of the records associated...
1
by: saranyagunasekaran | last post by:
I have1000 databases with table called tbl1 which has got enrolled as column name, need to get count of enrolled records from tbl1 for all 1000 databases using procedures.............or it would be...
19
by: cw11 | last post by:
How do I create code to swap data in a field for two different records in Access 2003? I want to create a button on a form that will allow me to swap data for a field. For example, if I have a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.