I use a subquery to return the invoice as an integer value in my main query. This query is used to overwrite an ASP.NET DataGrid, and there is only two character widths for this column. I want to limit the width to two characters. So, I want to set the value to 99 when the quantity exceeds 99. I can not figure out how to do this? I do not see how to apply the case argument here.
SELECT
MEMB_ID,
MEMB_Name,
SELECT COUNT(*)
FROM SessionOrder
WHERE SessionOrder.SORD_MEMB_ID = m.MEMB_ID
And SessionOrder.SORD_NumberCompleteDownloads <> 0
As MEMB_Downloads,
MEMB_JoinDate
FROM Member
How can I do that?
source
share