Sql problem

Results 1 to 2 of 2

Thread: Sql problem

  1. #1
    Join Date
    Dec 1969
    Posts
    36

    Default Sql problem

    I have this sql statement:<BR><BR>SQL = "Select YesNo, pt_designer, Max(pt_filename) from picture where pt_designer like &#039" & request.querystring("Var") & "%&#039 AND YesNo=True Group by pt_designer"<BR><BR>when I&#039m running it I get:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] You tried to execute a query that does not include the specified expression &#039YesNo&#039 as part of an aggregate function. <BR><BR>Help (& What does aggregate function means?)<BR>Thanks<BR>Ariel<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Sql problem

    An aggregate function is a function that works on multiple rows (like Max, Sum, Min, etc.). You need to GROUP all of your non-aggregate rows. So, you have "... GROUP BY pt_designer". You need to also add the column YesNo, so "... GROUP BY pt_designer, YesNo".

Posting Permissions

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