Monday, March 12, 2012

Group by weekends

Hi,
Does anyone know how to group by weekends?
Sample data and expected results, please?
Regards
Roji. P. Thomas
http://toponewithties.blogspot.com
"FJC" <FJC@.discussions.microsoft.com> wrote in message
news:936003D9-CC30-4880-AA51-48463A2C6036@.microsoft.com...
> Hi,
> Does anyone know how to group by weekends?
|||Confused,
Do you want to summarise data whcih are falling on week ends ?
|||This is the data:
value year month day
34 2006 2 1
35 2006 2 2
50 2006 2 3
57 2006 2 4
63 2006 2 5
46 2006 2 6
44 2006 2 7
35 2006 2 8
48 2006 2 9
39 2006 2 10
52 2006 2 11
58 2006 2 12
41 2006 2 13
43 2006 2 14
44 2006 2 15
37 2006 2 16
38 2006 2 17
57 2006 2 18
52 2006 2 19
54 2006 2 20
45 2006 2 21
36 2006 2 22
41 2006 2 23
56 2006 2 24
49 2006 2 25
57 2006 2 26
45 2006 2 27
39 2006 2 28
I want the average of the value column but just per each weekend.
"dineshasanka@.gmail.com" wrote:

> Confused,
> Do you want to summarise data whcih are falling on week ends ?
>
|||Hi FJC,
Use a calendar table then you will be able to query the joined tables for
weekends only.
Cheers
David Birkedale
"FJC" <FJC@.discussions.microsoft.com> wrote in message
news:936003D9-CC30-4880-AA51-48463A2C6036@.microsoft.com...
> Hi,
> Does anyone know how to group by weekends?
|||is this homework?
hint. datediff(), mod()
|||What do you mean?
This answer says nothing.
"Doug" wrote:

> is this homework?
> hint. datediff(), mod()
>
|||Thanks David, it worked!
"David Birkedale" wrote:

> Hi FJC,
>
> Use a calendar table then you will be able to query the joined tables for
> weekends only.
> Cheers
> David Birkedale
>
> "FJC" <FJC@.discussions.microsoft.com> wrote in message
> news:936003D9-CC30-4880-AA51-48463A2C6036@.microsoft.com...
>
>

No comments:

Post a Comment