Ola

Talvez voce deve usar diferentes parametros, assim:

select * from EMITIDOS where (day(DTEMISSAO_CHEMITIDOS)= :dd and month
(DTEMISSAO_CHEMITIDOS)= :mm and year(DTEMISSAO_CHEMITIDOS)= :aa)) or 
(day(DTCOMP_CHEMITIDOS)=:dd2 and month(DTCOMP_CHEMITIDOS)=:mm2 and year
(DTCOMP_CHEMITIDOS)=:aa2) or (day(DTVENC__CHEMITIDOS)=:dd3 and month
(DTVENC__CHEMITIDOS)=:mm3 and year(DTVENC__CHEMITIDOS)=:aa3)

Perdoem-me se o meu Portugues nao e bom ......

Steve


-----Original Message-----
From: delphi-br@yahoogrupos.com.br
[mailto:[EMAIL PROTECTED] Behalf Of Hudson Dias
Sent: 20 November 2008 22:35
To: delphi-br@yahoogrupos.com.br
Subject: [delphi-br] Duvidas com SQL


ola gente,

estou fazendo uma consulta em uma tabela access:
select * from EMITIDOS where (day(DTEMISSAO_CHEMITIDOS)= :dd and month
(DTEMISSAO_CHEMITIDOS)= :mm and year(DTEMISSAO_CHEMITIDOS)= :aa)) or 
(day(DTCOMP_CHEMITIDOS)=:dd and month(DTCOMP_CHEMITIDOS)=:mm and year
(DTCOMP_CHEMITIDOS)=:aa) or (day(DTVENC__CHEMITIDOS)=:dd and month
(DTVENC__CHEMITIDOS)=:mm and year(DTVENC__CHEMITIDOS)=:aa)

tbm tentei assim:
(select * from EMITIDOS where day(DTEMISSAO_CHEMITIDOS)= :dd and month
(DTEMISSAO_CHEMITIDOS)= :mm and year(DTEMISSAO_CHEMITIDOS)= :aa) 
union all (select * from EMITIDOS where day(DTCOMP_CHEMITIDOS)=:dd 
and month(DTCOMP_CHEMITIDOS)=:mm and year(DTCOMP_CHEMITIDOS)=:aa) 
union all (select * from EMITIDOS where day(DTVENC__CHEMITIDOS)=:dd 
and month(DTVENC__CHEMITIDOS)=:mm and year(DTVENC__CHEMITIDOS)=:aa)

Ambas as formas esta me retornando somente a primeira data 
(DTEMISSAO_CHEMITIDOS).

Gostaria que esta consulta tivesse o retorno dos 3 campos 
DTEMISSAO_CHEMITIDOS, DTCOMP_CHEMITIDOS e DTVENC__CHEMITIDOS para 
todos os resultados.

Grato...


------------------------------------

-- 
<<<<< FAVOR REMOVER ESTA PARTE AO RESPONDER ESTA MENSAGEM >>>>>





***************************************************************************
This e-mail and any files transmitted with it are confidential. If you are not 
the intended recipient, any reading, printing, storage, disclosure, copying or 
any other action taken in respect of this e-mail is prohibited and may be 
unlawful. If you are not the intended recipient, please notify the sender 
immediately by using the reply function and then permanently delete what you 
have received.
Content of emails received by this Trust will be subject to disclosure under 
the Freedom of Information Act 2000, subject to the specified exemptions, 
including the Data Protection Act 1998 and Caldicott Guardian principles.
This footnote also confirms that, unless otherwise stated, this email message 
has been swept by Sophos Anti-virus for the presence of computer viruses.
***************************************************************************

Responder a