🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.listserv.envbeh-l
Article #35

how can I build 2 queries in 1 query (VB SQL query)

#35
From: it2000china
Date: Sun, 01 Dec 2002 18:07
36 lines
1712 bytes
I am thinking to build a query in Ms VB to sort the database

I have 2 tables in Ms access database, 


table1
id1  name
1    abcd
2    defg
3    ghij
4    xhxk
5    fgdj


table2
id2  add1   add2
100  fsjs   jfkh
200  dfgg   ghfg
300  dfgh   jyuj
400  yuuy   jghj
500  jlas   adad


can I use VB SQL query to link this 2 table, set table1.id1*100=table2.id2

I tried below query, but doesn't work.

query1= select table1.id1,table1.name, [id1]*100 as id100 from table1

    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb;Persist Security Info=False"
    Adodc1.RecordSource = "select (query1).name, table2.add1, table2.add2
from (query1) inner join table2 on (query1).idd100=table2.id2"
  Set obj1 = Adodc1.Recordset

anybody can help to build this query in VB. please also forward a message to me at it2000china@yahoo.com
Technical Details
Message-ID: <12012002100702it2000china@yahoo.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!enews.sgi.com!newsfeed.ap.concert.net!newsvr.starhub.net.sg!news.starhub.net.sg!news.cyberway.com.sg

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1112ac,ff9f472061759ef1,start
X-Google-Attributes: gid1112ac,public
X-Google-ArrivalTime: 2002-11-30 18:07:59 PST
From: <it2000china@yahoo.com>
Newsgroups: bit.listserv.envbeh-l
Date: Sun, 01 Dec 2002 10:07:02 PST
Subject: how can I build 2 queries in 1 query (VB SQL query)
Organization: it2000china@yahoo.com
Message-ID: <12012002100702it2000china@yahoo.com>
content-length: 897
NNTP-Posting-Host: 218.186.82.106
X-Trace: 1 Dec 2002 10:08:16 +0800, 218.186.82.106
Lines: 38
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!enews.sgi.com!newsfeed.ap.concert.net!newsvr.starhub.net.sg!news.starhub.net.sg!news.cyberway.com.sg