Results 1 to 3 of 3

Thread: sql help

  1. #1
    Join Date
    Mar 2014
    Posts
    5

    Talking Unanswered: sql help

    Hi evryone

    Im getting an error that the expression is not part of the agregate function
    please help

    many thanks!


    SELECT IIf([Data]![GORDER]<>1,Null,[Data]![ASSMBLYNUM]) AS ASSMBLYNUM, Data.SEQ, Data.DRAWNUM, Data.TYPE FROM Data INNER JOIN [INDEX] ON Data.ASSMBLYNUM = INDEX.ASSBLYNUM WHERE INDEX.ASSBLYNUM IN("YSUOS7215L","YSUSDL6015L","") GROUP BY Data.ASSMBLYNUM, Data.SEQ, Data.DRAWNUM, Data.TYPE ORDER BY Data.CTYPE ASC, Data.SEQ ASC;

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You cannot use an alias in the GROUP BY part of the query. Repeat the expression used in the SELECT part.
    Have a nice day!

  3. #3
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I think you have to group on the actual expression, not the alias.
    Paul

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •