Select "Group By" Statement Does Not WOrk

  • I am using Dreamweaver MX4 with an ASP webpage that I have ODBC Access Table.

    Code1 works fine IF I put in a start and end date.

    As soon as I remove the hard-coded dates so that a user can input the desired dates from a webpage form I get ERROR the specified expression Field3 is not part of an aggregated function.

    Does anyone know what the Dreamweaver problem is?

    I can supply the entire source code if needed.

    Thank you....

    Rick:-):-)

    Code1

    SELECT Field3, Field10 , SUM(Field16) as SumofField16

    FROM CustomerHistory_CP

    WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #2009-01-01# AND Field6 <= #2009-10-31# GROUP BY Field3, Field10

    Code2

    SELECT Field3, Field10 , SUM(Field16) as SumofField16

    FROM CustomerHistory_CP

    WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #StartDate# AND Field6 <= #EndDate# GROUP BY Field3, Field10

  • There seems to be no change in Code1 and Code2 except hardcoded values..

    Are you making sure the Date value entered by the user (date input) is a valid date format.

    Is the front-end application performing the check on the user input?


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • I don't really know dreamweaver but it seems to me the issue must have something to do with the way you are passing the date variables. Are you using the right syntax?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply