A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I covert a week # to a Friday's date in a mm/dd/yy format?



 
 
Thread Tools Display Modes
  #1  
Old February 14th, 2005, 08:35 PM
zieki
external usenet poster
 
Posts: n/a
Default How do I covert a week # to a Friday's date in a mm/dd/yy format?

I have the dates coverted to week numbers so I can compare last year's data
to this year's data. But now, for some new reports I'm creating, I need to
convert a week number to a Friday's date.
i.e. Week 2 = 1/14/2005
please email me at
  #2  
Old February 15th, 2005, 06:40 PM
Tim Ferguson
external usenet poster
 
Posts: n/a
Default

"=?Utf-8?B?emlla2k=?=" wrote in
:

I have the dates coverted to week numbers so I can compare last year's
data to this year's data. But now, for some new reports I'm creating,
I need to convert a week number to a Friday's date.
i.e. Week 2 = 1/14/2005


It seems that everyone and his dog has a different algorithm for defining
weeknumbers, but this one seems to work for the n'th Friday after
01/01/xxxx --

Public Sub Friday(WeekNum As Integer, YearNum As Integer)

Dim dtTemp As Date
Dim wOffset As Integer

wOffset = Weekday(DateSerial(YearNum, 1, 1))
If wOffset = 7 Then wOffset = 0

dtTemp = DateSerial(YearNum, 1, 7 * WeekNum - wOffset)

Debug.Print Format(dtTemp, "dddd, dd/mm/yyyy")

End Sub


Hope it helps


Tim F

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Not Allow Date Past This Thursday Dave Elliott Using Forms 4 November 1st, 2004 09:39 PM
Grouping by date - How To: Show the first day of the week instead of the first date entered in that week... Neil Setting Up & Running Reports 4 October 8th, 2004 10:56 AM
QDE (Quick Date Entry) Norman Harker Worksheet Functions 37 September 5th, 2004 01:24 AM
Formula to return Friday's date: m/d/yyyy Austin M. Horst Worksheet Functions 6 April 24th, 2004 04:15 PM


All times are GMT +1. The time now is 10:33 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.