Skip to main content
Inspiring
July 28, 2008
Question

grouping by date

  • July 28, 2008
  • 2 replies
  • 325 views
Hello All
Im just about to start a new project and was woundering if any one had any pointers on how I can group by weeks when selecting data

Each line of data consists of a part number and a due date for example.
I wish to select data and group by weeks 21 / July - 27 / July etc

So all parts with a due date between week start and week end dates would get grouped up.

Question can you group on the TSQL statment by ISO weeks etc or will this have to be done in the CFM code?

Not asking for a solution here im very willing to sit and think for myself, just wondered on any pointers that might be around.

Kind Regards Guy
This topic has been closed for replies.

2 replies

Participating Frequently
July 29, 2008
Thanks Hagster.
For music visit http://mp3katalog.eu
HagsterAuthor
Inspiring
July 28, 2008
Hello All,

Well that was easy to work out :). Can do it in the TSQL, code below just in case any one was interested.

select month(planddate) AS plandate, planpart
, sum(planoq) AS planoq
from planned
group
by month(planddate), planpart

Kind Regards Guy