Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Live chat with experts, bring your API Integration questions. June 15th, 10 AM ET. REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
pzwonford
Contributor II
Contributor II

Import data from two tables

Hi guys. I have the following tables in an Access database:

Customer

CustomerID

Name

Active?

123

Bob smith

Yes

444

John Jones

Yes

990

Ed Johnson

No

087

Paul Crisp

Yes

Address

CustomerID

Address

123

1 Shakespeare Road, Bedford.

444

5 Dudley Street, Bedford

990

9 Holly View, Sowerby Bridge

087

18 Church Lane, Ravensden

I would like to import only customers who are active. The problem with this is that if I tell the code to import only active from the customer table, it still imports the inactive information (customer 990) from the address table. Can anyone suggest anything?

My basic code is as follows:


ODBC CONNECT32 TO [MS Access Database;DBQ=C:\Users\u22471\Desktop\QV\New Microsoft Access Database.accdb];
SQL Select *

FROM [Customer];
ODBC CONNECT32 TO [MS Access Database;DBQ=C:\Users\u22471\Desktop\QV\New Microsoft Access Database.accdb];
SQL Select *

FROM [Address];

1 Solution

Accepted Solutions
bill_markham

ODBC CONNECT32 TO [MS Access Database;DBQ=C:\Users\u22471\Desktop\QV\New Microsoft Access Database.accdb];
SQL Select *

FROM [Customer];
ODBC CONNECT32 TO [MS Access Database;DBQ=C:\Users\u22471\Desktop\QV\New Microsoft Access Database.accdb];

load *

where exists ( CustomerID ) ;

SQL Select *

FROM [Address];

View solution in original post

9 Replies
bill_markham

ODBC CONNECT32 TO [MS Access Database;DBQ=C:\Users\u22471\Desktop\QV\New Microsoft Access Database.accdb];
SQL Select *

FROM [Customer];
ODBC CONNECT32 TO [MS Access Database;DBQ=C:\Users\u22471\Desktop\QV\New Microsoft Access Database.accdb];

load *

where exists ( CustomerID ) ;

SQL Select *

FROM [Address];

View solution in original post

salto
Specialist II
Specialist II

Hi,

     Isn't it possible to add a where clause similar to:

         Active='Yes'

     And check the result?

pzwonford
Contributor II
Contributor II
Author

When i try this i get

SQL##f - SqlState: 07001, ErrorCode: 4294964286, ErrorMsg: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
SQL Select *

FROM [Customer]
Where [Active] = 'Yes'

Not applicable

Hi,

Here both ODBC connections are same so no need to write connection string two times

ODBC CONNECT32 TO [MS Access Database;DBQ=C:\Users\u22471\Desktop\QV\New Microsoft Access Database.accdb];
Customers:

SQL Select *

FROM [Customer] where Active<>'No';

inner join(Customers)

Address:
SQL Select *
FROM [Address];

san_qliklearn
Contributor III
Contributor III

Use :

where condition for Active column.

where Active ='Yes'

salto
Specialist II
Specialist II

Maybe:

SQL Select *

FROM [Customer]
Where [Active?] <> 'No'

pzwonford
Contributor II
Contributor II
Author

When i run this code i get

SQL##f - SqlState: 07001, ErrorCode: 4294964286, ErrorMsg: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
Customers:

SQL Select *

FROM [Customer] where Active<>'No'

salto
Specialist II
Specialist II

Is the field name correct [Active?]

pzwonford
Contributor II
Contributor II
Author


Sorry, i changed it to [Active] because i was worried the question mark was causing the issue which it wasnt