•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 391,566 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,610 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 1265 | Replies: 0
![]() |
•
•
Join Date: Dec 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
- time (Visual Basic 4 / 5 / 6)
- Complex Query Help (MS SQL)
- query for creating report group by weeks (with start date and end date of the week) (MS SQL)
- Problem with query. (MS SQL)
- SQL does not substract (MS SQL)
Other Threads in the MS SQL Forum
- Previous Thread: A New Break Line in SSRS
- Next Thread: Sql Server 2008


Linear Mode