Anyone any good at SQL?

nonsense and other stuff - Don't enter if easily offended !!!!!
MattB
Site Admin
Posts: 1609
Joined: Fri Dec 27, 2002 8:07 pm
Location: Leeds

Post by MattB »

Try putting those other columns it's complaining about at the end of the GROUP BY list

andyc209
Posts: 614
Joined: Wed Sep 25, 2002 10:21 am
Location: Biddulph

Post by andyc209 »

Done it...cheers

SELECT TOP 100 PERCENT MAX(dbo.faxlog.Col004) AS Expr1, dbo.faxlog.Col003, MAX(dbo.faxlog.Col005) AS Expr3, MAX(dbo.faxlog.Col007) AS Expr2, MAX(dbo.faxlog.Col008) AS Expr4, MAX(dbo.faxlog.Col009) AS Expr5, MAX(dbo.faxlog.Col010) AS Expr6, MAX(dbo.faxlog.Col011) AS Expr7, MAX(dbo.faxlog.Col012) AS Expr8, MAX(dbo.ZFAXerror.Description) AS Expr9
FROM dbo.faxlog INNER JOIN dbo.ZFAXerror ON dbo.faxlog.Col008 = dbo.ZFAXerror.Hex
GROUP BY dbo.faxlog.Col004, dbo.faxlog.Col003
HAVING (dbo.faxlog.Col003 = 'mpp') AND (MAX(dbo.faxlog.Col004) < '999999')
ORDER BY dbo.faxlog.Col004


:hyper: :hyper: :hyper:

Thanks for the help

:wave:
Duuhhh.... Peugeot Monkey Business.......

MattB
Site Admin
Posts: 1609
Joined: Fri Dec 27, 2002 8:07 pm
Location: Leeds

Post by MattB »

No worries mate. My fee is £250 per message. I accept cheques and credit cards.

andyc209
Posts: 614
Joined: Wed Sep 25, 2002 10:21 am
Location: Biddulph

Post by andyc209 »

:shock:
Duuhhh.... Peugeot Monkey Business.......

CB
Posts: 4312
Joined: Mon Apr 08, 2002 1:00 am
Location: Classified

Post by CB »

Lets just hope you don't have a French/ Italian/ American/ Chinese/ Russian built computer then! ;)
[img]http://bluntman.d2.net.au/newsmilies/brick.gif[/img]

CB
Posts: 4312
Joined: Mon Apr 08, 2002 1:00 am
Location: Classified

Post by CB »

Image
[img]http://bluntman.d2.net.au/newsmilies/brick.gif[/img]