Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

How to use sql select that combines data from multiple tables into single table in vb6

$
0
0

hi my name is vishal for past 5 days i have been nuts of how to combine data from multiple tables into single table using sql select query (join query) Given below i have tried solution but i get error message data not found. But in table i have datas

  SELECT [Inward].[agn], [item_master].[item_name], [Inward].[no_of_bundle], [store_master].[rack_name], [store_master].[store_no]
FROM (Inward INNER JOIN store_master ON [Inward].[store_no]=[store_master].[store_no]) INNER JOIN item_master ON [store_master].[user_id]=[item_master].[user_id]
WHERE [item_master].[status]=True And [Inward].[deleted_status]=False And [Inward].[closed_status]=False And [Inward].[agn]<>0 And [store_master].[status]=True;

however the problem lies in my sql select query above.

I have to show agn field from table named Inward,item_name field from table named item_master,no_of_bundle field from table named Inward,rack_name field from table named store_master,store_no field from table named store_master. When I tried the above query I get message that datas are not found for any agn. But in fact there are datas for agn I just need to check with another table named Stock_Register.

Given below are structure of my 4 tables:
table1: name:Inward
Column Name                                      DataType
mfr_ref_number                                       Text
no_of_bundle                                         Integer
supplier_id                                             Integer
DC_date                                              Date/Time
INV_date                                             Date/Time
row_upd_date                                     Date/Time
courier_name                                         Text
inward_type                                           Text
user_id                                         Long(contains values 0 for all entries)
DC_NO                                                   Text
closed_status                                       Boolean(true for some agn only)
to_dept                                                 Text
agn                                                       Long

table2:name:item_mater
Column Name                                       DataType
user_id                                                  Long(contains 0 as value for all)
row_upd_date                                      Date/Time
status                                                    Boolean
item_name                                             Text
item_parent                                            Long
item_price                                               Double
item_desc1                                             Memo
item_desc2                                             Memo
item_desc3                                              Memo
item_type                                                 Long
item_code                                                 Text
agn                                                          Long
measure_type                                         Text

table3:name: Stock_Register
Column Name                                           DataType
row_upd_date                                         Date/Time
technician_id                                               Long
user_id                                                        Long(contains 0 as value for all entries)
in_out_type                                              Integer
status                                                       Boolean
item_id                                                       Long
qty_debit                                                  Double
qty_credit                                                 Double
in_out_id                                                   Long
store_no                                                   Long
sl_no                                                         Text
ref_id                                                        Long

table4:name:store_master
ColumnName                                       DataType
rack_name                                             Text
rack_desc                                              Memo
user_id                                                  Long(contains 0 as value for all entries)
row_upd_date                                      Date/Time
status                                                   Boolean
store_no                                                 Long

Now I tried above query in various ways in correcting my query but I am going nuts over this problem.
Please tell me how to fix my sql select query. Any guidance or help in correcting my sql select query would be greatly appreciated. Can anyone help me fix this sql select query?


Viewing all articles
Browse latest Browse all 2535

Trending Articles