From: enrico via DotNetMonster.com on
i use sqlyog to test my query. i just drop and drag my fields and put some
criteria on what i want my query is to be, and it gave a "having" statement.
i didn't care at all because my query worked.

--
Message posted via http://www.dotnetmonster.com

From: Steve Gerrard on
enrico via DotNetMonster.com wrote:
> i use sqlyog to test my query. i just drop and drag my fields and put
> some criteria on what i want my query is to be, and it gave a
> "having" statement. i didn't care at all because my query worked.

I just thought it was unusual to say
HAVING (sum(tblseedsubsidy.NoOfBags) /2)

Normally criteria include some sort of comparision, such as
sum(tblseedsubsidy.NoOfBags) /2 > 0



From: Michel Posseth [MCP] on
1000 times sorry :-) i missed this
"i'm using mySQL as..........."

The SQL i Showed that would have solved the problem is in MSSQL dialect

MYSQL however uses a slightly different dialect

the solution for MYSQL would be


SELECT
IFNULL(tblseedsubsidy.NoOfBags,0) AS NoOfBags
FROM
agri.tbltrcclient
INNER JOIN agri.tblseedsubsidy
ON (tbltrcclient.ClientID = tblseedsubsidy.ClientID)
INNER JOIN agri.tblinventory
ON (tblseedsubsidy.SeedID = tblinventory.SeedID)
WHERE (tblseedsubsidy.CoOwner = '1'
AND tbltrcclient.TypeofSeed = 'Corn')
HAVING (sum(tblseedsubsidy.NoOfBags) /2);

HTH

And again sorry for missing the MYSQL part

Regards

Michel Posseth [MCP]







"enrico via DotNetMonster.com" wrote:

> it still doesn't work. it prompts an error something like "Incorrect
> parameter count...". is it possible that it doesn't recognize the isnull
> statement?
>
> --
> Message posted via DotNetMonster.com
> http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-vb-net/200805/1
>
>