473,396 Members | 2,010 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,396 software developers and data experts.

I got a databse here that was done a little different

This database has this in the table.
idnumber visitno record1 record2
1 1 3
1 2 3

in a query how do I get the average of the record?
I know its (3+3)/2 but I can't figure out how to average out 2 visits.

thanks big time this should be simple, do you use idnumber and forget
the visitno ?

again thanks for any help

Jerry
May 10 '06 #1
4 1053
Very simple - use the group by feature of the select query. This
should allow you to compute your average.

May 10 '06 #2
Try this...

Select IdNumber,Avg(Record1+Record2) as Average From Table1 group by
IdNumber

-Saran

May 10 '06 #3
sparks wrote:
This database has this in the table.
idnumber visitno record1 record2
1 1 3
1 2 3


What do record1 and record2 represent? Are they two separate attributes
of a record, or are they the same thing except two sepaate instances of
that thing.

If the latter, your database should be trashed immediately and redesigned.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
May 10 '06 #4
this was stupid of me to post this this way.
I am very sorry...it was late and I was tired.

it should have been
This database has this in the table.
idnumber visitno record1 record2
1 1 3 4
1 2 3 4

they have 2 forms visit1 and visit2 tied to the same table.
so now that its all entered they want the average of the records
over both visits
so I was doing 3+3 and 4+4 for each idnumber and getting the average
over both visits

I guess after this they will want the averages displayed as well.
I don't know I inheritated this one 2 yrs after the guy quit....weeeee
LOL

On Wed, 10 May 2006 01:02:49 -0230, Tim Marshall
<TI****@PurplePandaChasers.Moertherium> wrote:
sparks wrote:
This database has this in the table.
idnumber visitno record1 record2
1 1 3
1 2 3


What do record1 and record2 represent? Are they two separate attributes
of a record, or are they the same thing except two sepaate instances of
that thing.

If the latter, your database should be trashed immediately and redesigned.


May 10 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rw3iss | last post by:
Alright, I'll get to the point. I'm totally new to MySQL databases and PHP, but I can make nice webpages none the less. Basically, I need to learn how to create a webpage that searches a MySQL...
0
by: Jeroen Van Goey | last post by:
Hi, I want to put the OMIM databse locally on my computer. I downloaded the file genemap from ftp://ftp.ncbi.nih.gov/repository/OMIM/ It contains a list of fields, separated by the '|' character....
3
by: chora | last post by:
Hi, there is an existing application running on a SQL Server database. Now I have to built a different app, which will have two common tables with the existing database (Customers, sales) Is...
133
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
5
by: YM | last post by:
Hi, I have an ACCESS database on the web-server. I build my ASP-driven website around the database. If I need to update dynamic information on the website, I 1) download the entire database 2)...
2
by: chitrapu | last post by:
hiii everybody, i have a little code that inserts the data into the databse. but the problem is the insertion should be peroformed only when a button is clicked. i have problems in this because i...
5
by: JCCDEVEL | last post by:
Hello, We have a small program that allows licensees around the world to submit requests to our home office. They complete the request on an ASP form (with an HTM page) over a https connection. ...
1
by: Bakarre | last post by:
To display a field from databse and calculate time different -------------------------------------------------------------------------------- Good day, i have problem to display a field from...
11
by: tokcy | last post by:
Hi everyone, I am new in php and ajax, i am facing the prob while i click on element of first drop down then in second dropdown all element showl come from database. I mean i have three dropdown 1....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.