Hi all, I'm having some trouble getting commands to be available. Certain commands are grayed out, and i'm assuming not working.
For example I copied this code from online:
SELECT h.USERID, c.KEY1,
CASE srectype
WHEN 'A' THEN 'Appointments'
WHEN 'C' THEN 'Calls'
ELSE 'Nothing'
END AS ContactType,
COUNT(h.USERID) AS Total_Contacts,
COUNT(CASE WHEN resultcode BETWEEN 0 AND 4 THEN 1 ELSE NULL END) AS Contacts_Made,
COUNT(CASE WHEN resultcode = 4 THEN 1 ELSE NULL END) AS Sales
FROM CONTHIST h INNER JOIN
CONTACT1 c ON h.ACCOUNTNO = c.ACCOUNTNO
WHERE (h.USERID = @userident)
AND (h.ONDATE BETWEEN @startdate AND @enddate)
AND (h.SRECTYPE IN ('A', 'C'))
GROUP BY h.USERID, c.KEY1, h.SRECTYPE
ORDER BY h.USERID, c.KEY1, h.SRECTYPE
http://www.codeguru.com/forum/showthread.php?t=372235
From that bit of code the following commands are gray:
BETWEEN
AND
NULL
INNER JOIN
IN
I can only assume that i'm doing something fundamentally wrong. Is there a setting i'm missing in SQL Server Managment Studio EXpress to make these available? Do I need to 'import' anything?
TIA