Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by jegajothy
at 2024-11-20 16:30:12
Point:500 Replies:5 POST_ID:828434USER_ID:10
Topic:
Microsoft Access Database;;SQL Query Syntax
My OS is win exp prof. i have a database that has 2 tables. one is the zip codes only while the 2nd table contains names and addresses of clients.
The zip codes table has only one field zipcode, which contains the zip codes.
i would like to run a query to extract records from the 2nd table that contains names and addresses using the zip codes from the first table. I have not related the 2 tables. How is this done by a query. thanks.
The zip codes table has only one field zipcode, which contains the zip codes.
i would like to run a query to extract records from the 2nd table that contains names and addresses using the zip codes from the first table. I have not related the 2 tables. How is this done by a query. thanks.
Expert: hnasr replied at 2024-11-21 06:13:49
List few records from existing data and the expectge3d output.
Expert: MINDSUPERB replied at 2024-11-20 22:56:17
jegajothy,
Is there a zipcode field in your 2nd Table? If there is then you can create a realationship on it. JC's suggestion will do it. However, if your 2nd table has no zipcode field on it, you need to create that field on it.
Sincerely,
Ed
Is there a zipcode field in your 2nd Table? If there is then you can create a realationship on it. JC's suggestion will do it. However, if your 2nd table has no zipcode field on it, you need to create that field on it.
Sincerely,
Ed
Accepted Solution
Expert: JVWC replied at 2024-11-20 17:22:45
500 points EXCELLENT
Oops!
IE: drag Foreign Key to Primary key, or vice versa...
Cheers
JC
IE: drag Foreign Key to Primary key, or vice versa...
Cheers
JC
Expert: JVWC replied at 2024-11-20 17:20:33
You can add each of the tables in the query design window and create the relationship by dragging the field to be the key from one table to other.
Cheers
JC
Cheers
JC
Expert: duncanb7 replied at 2024-11-20 17:11:18
I just scan your question, hope it help for quick and using following simple for query to many tables you want
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://yourlinkwritehere, _
Destination:=Range("ai1"))
' .Name = "Quote: " & symb
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2,4,6,8,10 ''Edit many tables here
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://yourlinkwritehere, _
Destination:=Range("ai1"))
' .Name = "Quote: " & symb
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2,4,6,8,10 ''Edit many tables here
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With