[thelist] SQL Chaos!!

Joshua Olson joshua at waetech.com
Wed Jan 29 07:25:01 CST 2003


----- Original Message -----
From: "Martyn Haigh" <martyn.haigh at virgincosmetics.com>
Sent: Wednesday, January 29, 2003 7:34 AM


> Darren,
>
> Thanks for that - I'm a bit of a novice at SQL )c:  (trying to learn!)

Tip #1: Really pay attention to Rudy.  He has already provided the solution
to this problem.

> Using your code - I added a GROUP BY as I need it grouped by the date.
> Unfortunately it doesn't like the GroupDate in the Group By clause.
>
> SELECT
> Sum(i.OtherEnq),
> Sum(i.CatReq),
> Sum(i.KnowMore),
> CONVERT(varchar(10), g.DateCreated, 105) AS GroupDate
> FROM InterestedForm as i
> INNER JOIN GeneralForm as g ON i.ID = g.ID
> GROUP BY GroupDate

The GROUP BY clause should match the Expression that calculates GroupDate.
In this case, the GROUP BY clause should be:

GROUP BY CONVERT(varchar(10), g.DateCreated, 105)

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com
706.868.0240




More information about the thelist mailing list