on 09-17-2010 6:47 PM
estimados compañeros genere un query para saber la ganancia bruta de las facturas de algunos vendedores
pero me estna pidiendo el porcentaje por factura. no tengo tanto conocimiento de transact, asi quesi alguien me puede echar la mano le agradecere mucho.
trata que mi operación es el porcentaje de ganancia bruta. y lo que hago es el doctotal/100 y lo que me salga lo divido entre mi ganancia bruta. si alguien me puede ayudar.
o regla de tres. helpme :):D
esto es lo que tengo.
Declare @porcentaje real
Declare @uno real
Declare @part real
Set @porcentaje=@part/100
Set @portotal=@uno/@porcentaje
SELECT T1.[DocNum], T1.[DocDate], T1.[DocDueDate], T1.[CardCode], T1.[CardName],
@part=T1.[DocTotal], @uno=T1.[GrosProfit],T2.[DocDate] as 'fecha de pago', T0.NAME AS 'VENDEDOR',T3.[PymntGroup]
FROM [dbo].[@VENDEDORES] T0
INNER JOIN OINV T1 ON T0.Code = T1.U_CODIGO
INNER JOIN ORCT T2 ON T1.ReceiptNum = T2.DocEntry
INNER JOIN OCTG T3 ON T1.GroupNum = T3.GroupNum
WHERE T1.[DocType] ='i' and T3.[PymntGroup] =[%0] and (t1.docdate>=[%1] and t1.docdate<=[%2]) AND T2.CANCELED<>'Y' AND (T0.NAME='[%3]')
espero que me puedan ayudar. :):D
Edited by: mary merecias on Sep 17, 2010 12:41 PM
ya lo resolvi, muchas gracias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
7 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.