Skip to main content
Inspiring
May 7, 2012
Answered

MS SQL Error

  • May 7, 2012
  • 1 reply
  • 592 views

I am getting a mssql error,  below is the sql statement:

SELECT Products.Brief, (param 1) AS Cat, Max(IIf([Ext5] = 1 and [CFM] Not Like '%HD%',[Image],'00000')) AS FirstOfImage,

Count(Products.Seq) AS Qty

FROM Products WHERE ( ((Price)>0) AND ((Products.Cfm) Like '%Bath%') )

GROUP BY Products.Brief ORDER BY Products.Brief, Min(Products.Title)

The error is am getting:

Error Occurred While Processing Request

Error Executing Database Query.

[Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near '='.

Any help with my query would be great.

Anthony

    This topic has been closed for replies.
    Correct answer BKBK

    Wouldn't it be an idea to start with something like this?

    SELECT Brief, (param 1) AS Cat, MAX(image) AS FirstOfImage, COUNT(Seq) AS Qty

    FROM Products

    WHERE Price > 0 AND Cfm Like '%Bath%' AND Ext5 = 1

    GROUP BY Brief

    ORDER BY Brief, Min(Title)

    1 reply

    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    May 7, 2012

    Wouldn't it be an idea to start with something like this?

    SELECT Brief, (param 1) AS Cat, MAX(image) AS FirstOfImage, COUNT(Seq) AS Qty

    FROM Products

    WHERE Price > 0 AND Cfm Like '%Bath%' AND Ext5 = 1

    GROUP BY Brief

    ORDER BY Brief, Min(Title)