If this is the correct join (1 Viewer)

icedearth

Registered User.
Local time
Today, 03:31
Joined
Oct 10, 2008
Messages
24
i have try this but the querie freeze i have to put end task to terminate the quey
 

Attachments

  • example-2.JPG
    example-2.JPG
    79.8 KB · Views: 94

Brianwarnock

Retired
Local time
Today, 06:31
Joined
Jun 2, 2003
Messages
12,701
THisis going to be confusing for anybody who has not seen the original thread. Keep all posts concerning oone problem to one thread,
Can you copy and paste your SQL to a post as requested earlier in the other thread.

Brian
 

icedearth

Registered User.
Local time
Today, 03:31
Joined
Oct 10, 2008
Messages
24
SELECT DBA_INC_LOAN_BANK.LOAN_NUM, Nombre_Sucursales.NUMERO_SUCURSAL, Nombre_Sucursales.SUCURSAL, DBA_INC_LOAN_BANK.BRANCH_NUMBER
FROM (DBA_INC_LOAN_BANK INNER JOIN DBA_INC_MONTHLY_LOAN_MAIN ON DBA_INC_LOAN_BANK.LOAN_NUM = DBA_INC_MONTHLY_LOAN_MAIN.LOAN_NUM) RIGHT JOIN Nombre_Sucursales ON DBA_INC_LOAN_BANK.BRANCH_NUMBER = Nombre_Sucursales.NUMERO_SUCURSAL
WHERE (((Nombre_Sucursales.NUMERO_SUCURSAL)=CDbl(Right([DBA_INC_LOAN_BANK]![BRANCH_NUMBER],3))));
 

Brianwarnock

Retired
Local time
Today, 06:31
Joined
Jun 2, 2003
Messages
12,701
Given the Where clause I'm not convinced that you need the Right Join, infact I don't see how the 2 statements can work.

Brian
 

Brianwarnock

Retired
Local time
Today, 06:31
Joined
Jun 2, 2003
Messages
12,701
You could try

INNER JOIN Nombre_Sucursales ON Right(DBA_INC_LOAN_BANK.BRANCH_NUMBER,3) = Nombre_Sucursales.NUMERO_SUCURSAL

But you would not be able to view this in Design view only SQL.

Brian
 

icedearth

Registered User.
Local time
Today, 03:31
Joined
Oct 10, 2008
Messages
24
so it could lokk like this

SELECT DBA_INC_LOAN_BANK.LOAN_NUM, Nombre_Sucursales.NUMERO_SUCURSAL, Nombre_Sucursales.SUCURSAL, DBA_INC_LOAN_BANK.BRANCH_NUMBER
FROM (DBA_INC_LOAN_BANK INNER JOIN DBA_INC_MONTHLY_LOAN_MAIN ON DBA_INC_LOAN_BANK.LOAN_NUM = DBA_INC_MONTHLY_LOAN_MAIN.LOAN_NUM);
INNER JOIN Nombre_Sucursales ON Right(DBA_INC_LOAN_BANK.BRANCH_NUMBER,3) = Nombre_Sucursales.NUMERO_SUCURSAL

i have try this way and gave me an error that said characters found after end of SQL statement
 

Brianwarnock

Retired
Local time
Today, 06:31
Joined
Jun 2, 2003
Messages
12,701
The ; is in the wrong place.

SELECT DBA_INC_LOAN_BANK.LOAN_NUM, Nombre_Sucursales.NUMERO_SUCURSAL, Nombre_Sucursales.SUCURSAL, DBA_INC_LOAN_BANK.BRANCH_NUMBER
FROM (DBA_INC_LOAN_BANK INNER JOIN DBA_INC_MONTHLY_LOAN_MAIN ON DBA_INC_LOAN_BANK.LOAN_NUM = DBA_INC_MONTHLY_LOAN_MAIN.LOAN_NUM) INNER JOIN Nombre_Sucursales ON Right(DBA_INC_LOAN_BANK.BRANCH_NUMBER,3) = Nombre_Sucursales.NUMERO_SUCURSAL;

Brian
 

Users who are viewing this thread

Top Bottom