Skip to main content
Known Participant
May 19, 2016 3:15 PM UTC
Question

Coldfusion v2016 using SQL server query using order by right causes error.

Have query that worked until v2016.  Using order by right(LogNumber,3) DESC get error:

Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'right'

query:

  SELECT LogNumber

  FROM tblMain

  WHERE (Program = 'Apple')

  ORDER BY right(LogNumber,3) DESC

    This topic is closed to new replies. Start a new post to keep the conversation going.

    4 replies

    Carl Von Stetten
    Legend
    May 19, 2016 4:14 PM UTC

    Have you applied Update 1 yet?  If so, was this working before the update?

    I wonder if it is somehow related to this similar CF11 Update 8 bug: Bug#4153580 - Coldfusion 11 update 8 breaks left and right sql sever functions

    Translate
    Known Participant
    May 19, 2016 4:36 PM UTC

    I had already installed the Update1 so I uninstalled it and it still does not work.  I looked at the bug#4153580 and that appears to me my problem.  I have determined that if you have a right in the query it works, it's only if you have it in the order by that it doesn't work.

    Translate
    WolfShade
    Legend
    May 19, 2016 7:00 PM UTC

    Can you add another column to your select and order by on that?

      SELECT LogNumber, right(LogNumber,3) as rlog

      FROM tblMain

      WHERE (Program = 'Apple')

      ORDER BY rlog DESC

    HTH,

    ^_^

    Translate