Count Query from two tables (1 Viewer)

Romio68

Registered User.
Local time
Today, 03:42
Joined
Sep 4, 2013
Messages
27
I have TableA with
CityCode (indexed, no duplicates, Primary Key)
CityType (duplicates ok)

TableB, with
CityCode (indexed, duplicates OK)
StreetCode (indexed, No Duplicates, Primary Key)

A One to Many relation between Tables on City Code

In need to feed a cell table with the value of the number of streets that are in "Type1" cyties

please help...
 

ChristopherL

Registered User.
Local time
Yesterday, 17:42
Joined
Jul 2, 2013
Messages
90
"In need to feed a cell table with the value of the number of streets that are in "Type1" cyties" What does this mean?

You want to make a query that selects all cities with type1? I don't understand the end-product you want.
 

Romio68

Registered User.
Local time
Today, 03:42
Joined
Sep 4, 2013
Messages
27
let me restate...

In need to feed a cell table with the count of the records in table B, Column StreetCode, under condition "CityType = 'Large'" from Table A.

Again, the two tables are related via CityCode.
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 20:42
Joined
Jan 23, 2006
Messages
15,394
Still not clear.
What is
a cell table
?

Can you gives us some sample data and show what result you expect?
 

Romio68

Registered User.
Local time
Today, 03:42
Joined
Sep 4, 2013
Messages
27
Table 1
PK
[CityCode]___Type
001_________A
002_________A
003_________B
004_________B
005_________A
006_________B
Table 1
FK______________________PK
CityCode___Street________[Street Code]
001_______Main__________ 001.1
001_______51'st__________001.2
001_______52'nd_________ 001.3
002_______John__________ 002.1
003_______Central________003.1
004_______Boardwalk______004.1
005_______51____________005.1
005_______2'nd__________005.2
006_______Lafayete______006.1

I want to count how many streets are in Type A Cities and have the result feed to a form textbox
in our case, in my textbox I should have 6 street codes in type A cities and 3 in type B
I need the query SQL statement for this
 

Users who are viewing this thread

Top Bottom