Comparing a value of one table, with interval in another table

Asked

Viewed 24 times

0

I am very lay in Access, but I need to use it to solve a problem.

Assuming I have two tables (just to illustrate):

Table A:

CEP INICIO | CEP FINAL | CDD | CTC
20000-000  | 29999-999 | CDD Exemplo 1 | CTC Exemplo 1
30000-000  | 39999-999 | CDD Exemplo 2 | CTC Exemplo 2
40000-000  | 49999-999 | CDD Exemplo 3 | CTC Exemplo 3

Table B:

NOME | CEP
Fulano | 31564-888
Joãozinho | 22559-010
Pedrinho | 44411-000

How can I know the value of CDD and CTC for people in table B??

1 answer

0

Create a new query (menu Criar > Design da Consulta) and in design mode (clique com o botão direito e selecione Modo SQL), Enter the code below:

SELECT cliente.cep, cliente.*, preco.*
FROM cliente, preco
WHERE (((cliente.cep)>=[preco]![cepinico] And (cliente.cep)<=[preco]![cepfim]));

Then you just run

  • I’ll try to find out how to run this command, thank you.

  • I don’t know how to run this command!

  • Thank you very much!!

  • But he asks me to "insert parameter value"...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.