luizcruz 0 Newbie Poster

hello there...
i need help with cross tab query with sum(case actually iam using ms access 2007 and vb.net 2005 i have problems with the sintaxis ill paste the code below:

TRANSFORM SUM(cantidad*(case tipo WHEN 'Entrada' else 1 then 1 end 0)-cantidad(case tipo WHEN 'Salida' else 1 then 0 end)) AS TOTAL
SELECT S.nombre,S.grupo,SUM(cantidad) AS Sub
FROM Movimiento AS M, Punto AS P, Sorteo AS S
WHERE(M.id_sorteo = s.id_sorteo And M.id_punto = P.id_punto)
GROUP BY P.nombre, S.nombre, S.grupo ORDER BY grupo PIVOT P.nombre"

i need the correct sintaxis for this sentece:
SUM(cantidad*(case tipo WHEN 'Entrada' else 1 then 1 end 0)-

or another way to do this , the finally of this query is get the actual inventory.

regards, hope anyone could help me