Commands not available in 2005 Express

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • newbtemple
    New Member
    • Feb 2008
    • 31

    Commands not available in 2005 Express

    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.co m/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
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by newbtemple
    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.co m/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
    Did you execute the query? Some query editor "gray out" to stress reserve words. I have not used SQL Express before but most of those keywords are basics of t-sql so I assume they would work, sometimes even cross-platform. Try executing the code or try to create simple queries using them.

    Happy coding

    -- CK

    Comment

    Working...