469,330 Members | 1,299 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,330 developers. It's quick & easy.

@@identity

I got two tables

one table has the fields ie table1

orderid ofd orderdate customername

where order id is autonumber

the other table2

orderid ofd product id productname


the problem here is that
if customer purchases 3 product at a time all the 3 products get the same ofd number ........and any 2 customers can have the same ofd number................ now i have to pull the order ID value from table 1 to table 2............ can somebody help with this i am the front end is asp.net amd the database is done on SQL server management studio
Feb 29 '08 #1
1 1220
ck9663
2,878 Expert 2GB
I got two tables

one table has the fields ie table1

orderid ofd orderdate customername

where order id is autonumber

the other table2

orderid ofd product id productname


the problem here is that
if customer purchases 3 product at a time all the 3 products get the same ofd number ........and any 2 customers can have the same ofd number................ now i have to pull the order ID value from table 1 to table 2............ can somebody help with this i am the front end is asp.net amd the database is done on SQL server management studio

use the two fields as your join key.... something like:

Expand|Select|Wrap|Line Numbers
  1. SELECT t1.orderid, t1.ofd, orderdate, customername, product_id, productname
  2. from table1 t1 inner join t2 on t1.orderid = t2.orderid and t1.ofd and t2.ofd
  3.  

-- CK
Feb 29 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Edward | last post: by
5 posts views Thread by DBA | last post: by
5 posts views Thread by grzes | last post: by
13 posts views Thread by PinkBishop | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.