Do you have a space between PartNumber and Like?
Also there's not need to ORDER BY - the GROUP BY does that anyway (I know
that's the case elsewhere)
and finally, I have to guess that it's objecting to Obsolete not being in
the main select.. have you tried including it and grouping by it? you can
ignore the obsolete in the main select when it's returned since it will all
be the same value... put it first.

Alan

> -----Original Message-----
> From: Ed Reed [mailto:ereed@;nearfield.com]
> Sent: Tuesday, 12 November 2002 18:54
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: Newbie Question - Query works in access but not MySQL
>
>
> UPDATE:
>
> Still trying to solve this and I think I have something that's a little
> easier to understand. If I run the following query against MySQL it
> returns "Unknown column 'Obsolete' in 'having clause'". If I run the
> query using MSAccess as a frontend to MySQL the query runs correctly (it
> returns a recordset with 9 records). If I remove the Obsolete column
> from the Having clause the MySQL server appears to hang up while it
> processes the query but it never returns even if left for an hour.
>
> Please, has anyone got any ideas?
>
> SELECT Products.PartNumber, Sum(tblInvTransaction.Qty) AS SumOfQty
> FROM Products LEFT JOIN tblInvTransaction ON Products.ProductID =
> tblInvTransaction.ProductID
> GROUP BY Products.PartNumber
> HAVING ((Products.PartNumberLike "%A-000%") AND
> (Products.Obsolete<>-1))
> ORDER BY Products.PartNumber;
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to