|
-
Sep 10th, 2006, 12:46 PM
#1
Thread Starter
Lively Member
SQL query not returning all data
Hi all
Can someone help me out with this? I have three tables in a database:
EquipType
"EquipTypeId","EquipTypeDesc"
"1 ","PABX"
"2 ","Servidores"
"3 ","Redes"
"4 ","type 3"
EquipVendor
"EquipTypeId","EquipVendorId","EquipVendorDesc"
"1 ","1 ","Nortel"
"1 ","2 ","Alcatel"
"2 ","3 ","HP"
"2 ","4 ","Compact"
"3 ","5 ","Krone"
"3 ","6 ","BrandRex"
"1 ","7 ","Aascom"
"1 ","8 ","Matra"
EquipModel
"EquipTypeId","EquipVendorId","EquipModelId","EquipModelDesc"
"1 ","1 ","1 ","Meridian1"
"1 ","1 ","2 ","BCM"
"1 ","2 ","3 ","View"
"1 ","2 ","4 ","OmniPCX"
"2 ","3 ","5 ","HP21"
"2 ","3 ","6 ","HP22"
"2 ","4 ","7 ","Proliant 5000"
"2 ","4 ","8 ","Proliant 7000"
"3 ","5 ","9 ","Cat5e da Krone"
"3 ","5 ","10 ","Cat3 da Krone"
"3 ","6 ","11 ","Cat6 "
"3 ","6 ","12 ","Cat7"
"1 ","7 ","13 ","nexpan"
"1 ","1 ","14 ","test"
I need to get ALL recods from the tables in a format something like this :
PABX Nortel Meridian1
PABX Nortel BCM
PABX Aastra nexpan
and so on. I need to get even the empty ones
I have this query:
"SELECT EquipType.EquipTypeId AS TypeId," & _
" EquipType.EquipTypeDesc AS TypeDesc," & _
" EquipVendor.EquipVendorId AS VendorId," & _
" EquipVendor.EquipVendorDesc AS VendorDesc," & _
" EquipModel.EquipModelId AS ModelId," & _
" EquipModel.EquipModelDesc AS ModelDesc" & _
" FROM EquipType, EquipVendor, EquipModel" & _
" WHERE EquipVendor.EquipTypeId = EquipType.EquipTypeId" & _
" AND EquipModel.EquipTypeId = EquipType.EquipTypeId" & _
" AND EquipModel.EquipVendorId = EquipVendor.EquipVendorId" & _
" ORDER BY EquipType.EquipTypeId"
This does not return EquipType EquipTypeId 4.
I have tried the INNER JOIN but but gave me sintax errors.
Can someone get me a query which will give me all records? I'm using this against a Access Database with VB6
Thanks
Last edited by reisve; Sep 11th, 2006 at 04:15 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|