0

i would like to query a date which only showing work week and year... i try in FORMAT([MYDATE], 'WW YYYY', 1, 2)... it work but when goes to 31/12/2006 it showing "01 2006"... but suppose it should show "01 2007" how can i overcome this?

4
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by morgan9
0

i would like to query a date which only showing work week and year... i try in FORMAT([MYDATE], 'WW YYYY', 1, 2)... it work but when goes to 31/12/2006 it showing "01 2006"... but suppose it should show "01 2007" how can i overcome this?

I am not clear what you are trying to do, can you eplain a bit more please.

Also 31/12/2006 should be 52 2006 surely ?

Denis

0

I am not clear what you are trying to do, can you eplain a bit more please.

Also 31/12/2006 should be 52 2006 surely ?

Denis

i'm looking query for work week and year in one column... so when comes to 31/12/2006 it should be return ww01 year 2007 instead of ww01 year 2006.

0

Where Is The Formatting Taking Place - SQL ?

FORMAT Is A (Among Other Things) A VB/VBA Command - NOT SQL

Regardless Of This, 31st Dec Is the 1st (Or 2nd Day In A Leap Year) Day In The 53rd Week. 52 * 7 = 364

You Say You Want The Working Week. What Exactly Is This ? What Day Does Your Week Start.

Also If 30th Dec 2006 = 52 2006 Week 1 Day 1 = 1st Jan 2006
However You Say You Want 31st Dec 2006 = 01 2007 - This Means 1st Jan Is Week 1 Day 2

This Is Not Consistant

Try Using The Days In The Year - WW = ((Days DIV 7) MOD 52) + 1

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.