|
jtiago
Starting Member
Portugal
1 Posts |
Posted - 02/28/2013 : 05:36:44
|
i need to write a query from one table but with elements from documents with diferent internal numbers.
how can i relate the two diferent internal numbers of documents on the query?
select bo.orinopat as 'N PAT', bo.no as 'Cliente', bo.nome as 'Nome Cliente', bo.fref as 'N OBRA', bo.obrano as 'N FObra', bo.dataobra as 'Data FObra', bo.datafecho as 'Dt Fecho FO', bo.vendnm as 'Comercial', bo.ecusto as 'Custo FObra', bo.etotaldeb as 'Valor Venda', ((((bo.etotaldeb-bo.ecusto)*100))/bo.etotaldeb) as 'Margem Percent' From bo Where bo.ndos like 32
(Select bo.orinopat as 'N PAT', bo.no as 'Cliente', bo.nome as 'N Cliente', bo.obrano as 'N Orç', bo.dataobra as 'Data Orç', bo.datafecho as 'Dt Fecho Orc', bo.vendnm as 'Comercial', bo.datafinal as 'Dt Adj', bo.etotaldeb as 'Total Venda', bo.ecusto as 'Custo Previsional', bo.u_cpag as 'Cond Pag 1', bo.u_evala as 'Euros Cond Pag 1', bo.u_cpaga as 'Cond Pag 2', bo.u_evalb as 'Euros Cond Pag 2' From bo Where bo.ndos like 11)
JTiago |
|