Hello, i try to convert this kind of sql query into linq in visual basic, but i get stuck on how to make a percent.. I also don't know how to use linqpad for creating this linq Please help.
SELECT CASE RIGHT(PICName, 3)
WHEN '(P)' THEN 'Problem'
WHEN '(R)' THEN 'Request'
ELSE 'Other'
END AS [Requests/Problems],
COUNT(RIGHT(PICName, 3)) AS Amount,
CONVERT(decimal(18, 2),
CONVERT(Decimal(18, 2), COUNT(RIGHT(PICName, 3))) /
CONVERT(Decimal(18, 2),
(SELECT COUNT(RIGHT(PICName, 3)) FROM Ticket))
* 100) AS [% Amount]
FROM Ticket
GROUP BY RIGHT(PICName, 3)
i need to export the result to a datagrid it's like:
Requests/Problems | Amount | % Amount
------------------------------------------------------
Problem | 20 | 20.00
Request | 45 | 45.00
Other | 35 | 35.00
Thank You.