Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Query Assistance


Message #1 by "Maha Arupputhan Pappan" <mahap@p...> on Sat, 25 Jan 2003 03:06:20
I have two tables and with 3 fields.

TABLENAME     FIELDNAME
TableA        StockCode
              Qty
              Price

TableB        StockCode
              Qty
              Price

I wish to make a query, whereby I can retrieve StockCode and Price from 
the two tables which will give me the following results:

STOCKCODE     PRICE1     PRICE2     DIFF.
ABC01         $10.00     $14.00     $4.00
DEF01         $15.00     $18.00     $3.00
GHI01         $20.00     $24.00     &4.00

Thanks,
Maha
Message #2 by gburke4@b... on Sun, 26 Jan 2003 00:26:33
> I have two tables and with 3 fields.

> TABLENAME     FIELDNAME
T> ableA        StockCode
 >              Qty
 >              Price

> TableB        StockCode
 >              Qty
 >              Price

> I wish to make a query, whereby I can retrieve StockCode and Price from 
t> he two tables which will give me the following results:

> STOCKCODE     PRICE1     PRICE2     DIFF.
A> BC01         $10.00     $14.00     $4.00
D> EF01         $15.00     $18.00     $3.00
G> HI01         $20.00     $24.00     &4.00

> Thanks,
M> aha
Message #3 by gburke4@b... on Sun, 26 Jan 2003 00:27:48
Hi there
SELECT Table1.StockCode, TableA.Price1, TableB.Price2, [Price2]-[Price1] 
AS Diff
FROM TableA INNER JOIN TableB ON TableA.StockCode = TableB.StockCode
WITH OWNERACCESS OPTION;

Regards


> I have two tables and with 3 fields.

> TABLENAME     FIELDNAME
T> ableA        StockCode
 >              Qty
 >              Price

> TableB        StockCode
 >              Qty
 >              Price

> I wish to make a query, whereby I can retrieve StockCode and Price from 
t> he two tables which will give me the following results:

> STOCKCODE     PRICE1     PRICE2     DIFF.
A> BC01         $10.00     $14.00     $4.00
D> EF01         $15.00     $18.00     $3.00
G> HI01         $20.00     $24.00     &4.00

> Thanks,
M> aha
Message #4 by "Maha Arupputhan Pappan" <mahap@p...> on Wed, 29 Jan 2003 14:17:04
Hi friend,

Thanks for your assistance. I tried your SQL and it was just what I wanted.

Regards,
Maha

  Return to Index