User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 426,141 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,699 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser: Programming Forums
Views: 1771 | Replies: 4
Reply
Join Date: Oct 2005
Posts: 7
Reputation: lsy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
lsy lsy is offline Offline
Newbie Poster

Need help in work week

  #1  
May 7th, 2007
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?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Location: Oxfordshire, England
Posts: 307
Reputation: DenisOxon is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 14
DenisOxon's Avatar
DenisOxon DenisOxon is offline Offline
Posting Whiz

Re: Need help in work week

  #2  
May 13th, 2007
Originally Posted by lsy View Post
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
Reply With Quote  
Join Date: Oct 2005
Posts: 7
Reputation: lsy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
lsy lsy is offline Offline
Newbie Poster

Re: Need help in work week

  #3  
May 13th, 2007
Originally Posted by DenisOxon View Post
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.
Reply With Quote  
Join Date: May 2007
Location: Warrington, England
Posts: 31
Reputation: SkinHead is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
SkinHead SkinHead is offline Offline
Light Poster

Solution Re: Need help in work week

  #4  
May 14th, 2007
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
Reply With Quote  
Join Date: May 2007
Posts: 2
Reputation: morgan9 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
morgan9 morgan9 is offline Offline
Newbie Poster

Re: Need help in work week

  #5  
May 26th, 2007
This is how your code should read:

FORMAT$([MyDate], "ww", "yyyy", 1,2)
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS Access and FileMaker Pro Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MS Access and FileMaker Pro Forum

All times are GMT -4. The time now is 4:56 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC