Boa Tarde, utilizo em Query(BDE DBTables) do delphi 5 a sintaxe que
pretendo transferir para o TSQLDataSet do DBExpress, porém dá um erro
ao tentar activar o componente; o que poderá estar errado ??

select mat.tdia, mat.tmes, mat.tano, sum(mat.tnotto) as Matriz,
(select  sum(f03.tnotto) from estf03 f03
where (mat.tdia = f03.tdia) and (mat.tmes = f03.tmes) and (mat.tano =
f03.tano)
and (f03.topera = 2) and (f03.thisto = 'S')) as Brasilia,
(select  sum(f04.tnotto) from estf04 f04
where (mat.tdia = f04.tdia) and (mat.tmes = f04.tmes) and (mat.tano =
f04.tano)
and (f04.topera = 2) and (f04.thisto = 'S')) as Poa,
(select  sum(f05.tnotto) from estf05 f05
where (mat.tdia = f05.tdia) and (mat.tmes = f05.tmes) and (mat.tano =
f05.tano)
and (f05.topera = 2) and (f05.thisto = 'S')) as Belo,
(select  sum(f06.tnotto) from estf06 f06
where (mat.tdia = f06.tdia) and (mat.tmes = f06.tmes) and (mat.tano =
f06.tano)
and (f06.topera = 2) and (f06.thisto = 'S') and  (f06.tufc <> 'SP'))
as Curitiba,
(select  sum(f06.tnotto) from estf06 f06
where (mat.tdia = f06.tdia) and (mat.tmes = f06.tmes) and (mat.tano =
f06.tano)
and (f06.topera = 2) and (f06.thisto = 'S') and  (f06.tufc = 'SP'))
as CuritiSP,
(select  sum(f07.tnotto) from estf07 f07
where (mat.tdia = f07.tdia) and (mat.tmes = f07.tmes) and (mat.tano =
f07.tano)
and (f07.topera = 2) and (f07.thisto = 'S')) as SantaCata
    from estmat mat
where (mat.tmes = :pmes) and (mat.tano = :pano) and (mat.topera = 2)
and (mat.thisto = 'S')
group by mat.tdia, mat.tmes, mat.tano
order by mat.tdia

grato

Stainle





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

<*> Para ver as mensagens antigas, acesse:
    http://br.groups.yahoo.com/group/delphi-br/messages

<*> Para falar com o moderador, envie um e-mail para:
    [EMAIL PROTECTED]




Links do Yahoo! Grupos

Responder a