home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Count

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1687
Discussions: 200,924, Posts: 2,379,120, Members: 246,290
Old June 22nd, 2002, 02:23 AM   Digg it!   #1 (permalink)
Junior Member
 
Join Date: Jun 2002
Location: Papua New Guinea
Posts: 12
Count

I'm creating a database on a library. As you know there are books e.g. text books, with the same title, but numerous copies. However each copy has a unique Serial No. To find the number of copies available for a certain title, I need to count the number of records of the Serial No.
So I need to know how to count the records in the Serial No table, and then store that value to a field. Can anyone help me with this
shahzadsk is offline   Reply With Quote
Old June 22nd, 2002, 02:48 AM     #2 (permalink)
Banned
 
Blood_Luster's Avatar
 
Join Date: May 2002
Location: Walnut Creek, CA
Posts: 713
Send a message via AIM to Blood_Luster
You mean a progam... or ... hmmn, I lost, someone else will help you, sorry
Blood_Luster is offline   Reply With Quote
Old June 22nd, 2002, 03:32 AM     #3 (permalink)
Not Really a Member
 
Join Date: Oct 2001
Posts: 25,384
ok...
So you're trying to group by serial number and get a count right?
SELECT SerialNum, Count(SerialNum)
FROM TableName
GROUP BY SerialNum

... think that works... sql is getting rusty
Then if you wanted to create a table with that information...
SELECT SerialNum, Count(SerialNum) AS CountOfSerialNum
INTO NewTableName
FROM TableName
GROUP BY SerialNum
__________________
Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.
vass0922 is online now   Reply With Quote
Old June 24th, 2002, 02:26 AM     #4 (permalink)
Junior Member
 
Join Date: Jun 2002
Location: Papua New Guinea
Posts: 12
thanks I'll give it a shot and let you know..any other suggestions I can try though?
shahzadsk is offline   Reply With Quote
Old June 25th, 2002, 10:57 AM     #5 (permalink)
Junior Member
 
Join Date: Jun 2002
Location: Papua New Guinea
Posts: 12
Where do I put that code in? In VB, it doesn't seem to work.. Sorry I'm very new at this
shahzadsk is offline   Reply With Quote
Old June 25th, 2002, 11:55 PM     #6 (permalink)
Banned
 
qball's Avatar
 
Join Date: Oct 2001
Posts: 447
ugh, hate access.

Anyway, the SQL for the counts is correct, vass0922.

Now, you need to open the access DB, and go to 'Queries'.

5 ways to do this (or more), here's one...

double clickey 'Create query in design view'.
will ask to choose tables and other stuff in 'Show Table' dialog.
just click close. Then View, SQL view.

Cut-n-paste, or write query, then Query, Run to see results or errors. Tweak from there...
qball is offline   Reply With Quote
Old June 26th, 2002, 05:04 AM     #7 (permalink)
Junior Member
 
Join Date: Jun 2002
Location: Papua New Guinea
Posts: 12
Okay.. this is what I did.. I made a form of the books (title, author etc) and made a subform (serial nos)..and in the subform put a control =count(*)
It works fine.. except it only updates when I click on the next and previous button on the form (those triangles).. anyway I can make it update every second or so?
shahzadsk is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2863)
Obama the Muslim (14)
California Passes Anti-Flat-HDTV Le.. (39)
Is the PSU I received dead? (10)
windows vista security holes (9)
Foreign voltage (10)
Install XP pro and a Vista laptop ?.. (10)
HIS HD5770 graphic card question (15)
Print spooler problem (13)
Dept. of HS: NSA 'Helped' Develop V.. (15)
A good PSU? (10)
New Computer wont recognize XP disc (7)
Ideal cheap graph card for PC-Gamin.. (15)
EVGA 9800 gtx help with finding a g.. (8)
Recent Discussions
Have you switched yet? (84)
Install XP pro and a Vista laptop ?? (10)
Wireless Router+Cable Modems and Much.. (0)
Optical Audio A-B Switch (1)
windows vista security holes (9)
Fire in DVD (0)
radeon x850xt platinum & shader 3 (2)
The NTDVM CPU has encountered an ille.. (24)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (34)
Wireless speakers for PC? (11)
Print spooler problem (13)
Help getting around port 80 for camer.. (2)
Display shows 3x5 inch in middle of s.. (3)
monitor will not turn on at all, (1)
World's largest Monopoly Game using G.. (331)
Foreign voltage (10)
FiOS modem/router interfering with ne.. (7)
Browsers wont load websites (2)
Virus Doctor Popup? (1)
Dept. of HS: NSA 'Helped' Develop Vis.. (15)
EVGA 9800 gtx help with finding a goo.. (8)
Modern Warfare For the PC (32)
Problem with speed step/turbo boost? (1)
Modern Warfare 2: Who Bought It? (61)
SIS 740 and Widescreen (8)


All times are GMT -4. The time now is 11:54 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28