Date From Week Number --RESOLVED--
I am saying the first week number is the week which the first of January is in, and the week starts on a saturday.
I am recording login's in a database using the date but want to search it using the week number.
Is there any way which i can get the start and end dates of the week number so i can search the data using these as parameters.
to get the week number i am using the datepart function.
Any help is much appreciated
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Find Week Start Date From The Week Number
Does anyone know a way to find the start of the week from a given week number?
For example we are in week 32 this year and the start date is 2/08/04.
I have used the following to find the week number:
Code:
Private Sub getWeekNumber()
'This fantastic bit of code returns the week number
Dim iNumberOfTheWeek As Integer
iNumberOfTheWeek = DatePart("ww", Now())
End Sub
But now I want to find the date range that any given week covers.
Any ideas?
Week Number And Week Ending Date In VB 6
Hi,
I'm trying to get the system's week number and its week ending date using the VB FORMAT function. For the week number is pretty simple and it works fine but its week ending date I can't find the function. It has to be a function for this instead of codes.
For my week number is this:
test1 = format (date, "ww") 'it gives me the current week number (numbers from 1 to 52)
Now from that week number I would like to get the week date ending, eg.
for week 19 its ending date would be 05/10/2003 (Saturday May 10, 2003)
Any ideas?
Thank you
Olivia
Date Of First Day Of The Week From A Week Number
Does anyone know of a way to get the date for the first or last (It really doesn't matter) day a week given a week number?
I'm calculating the week number by using:
VB Code:
lcurrentweek = format(Now, "ww")lcurrentweek + 1...lcurrentweek + 9 'Then i'd like to find the first or last day of each of those
I guess since I'm just trying to get the first dates of the next nine weeks that i could just find the first date of this week and keep adding seven too it?
Thanks
Andy
Week Number --> Date?!
What I wish to do is this:
User selects a week number, and a combobox is filled with the dates (monday through sunday) corresponding to the specific week. For example the user selects week 43, and the combo contains this:
Monday 21-10-2002
Tuesday 22-10-2002
...etc...etc
Sunday 27-10-2002
Any suggestions?
(I live in Denmark, and therefore the first day of the week is vbMonday)
How Do I Get A Week Number Out Of Date?
That is my problem. I read a date (ie. 14.10.2004) and I need a function, which tells me which week number that day belongs (in this case, week 46). Any idea is appreciated. Thank you.
- - - - - - - - - - - - - - - - - - - -
Long days and pleasant nights
- Roland the Gunslinger
- - - - - - - - - - - - - - - - - - - -
Computing Date From Mix Of Date & Week Number.
I am given a date in the form month/Week Number/Year. (Why it's being passed like this is a whole other matter)
So, 01/03/2006 would mean "The 3rd week in January", 02/04/2004 would mean "The 2nd week of Febuary"...
Does anyone know of a quick & dirty way of converting this to a standard date? We're looking for something that goes to the first day of the specified week, in our case Sunday.
So 01/03/2006 would convert to 01/15/2006
02/04/2004 would be 02/22/2004
Any ideas would be appriciated & Thanks.
*RESOLVED* Given A Date Return The Date Of Monday The Same Week
I'm stumped. The title says it all.
I need the date of Monday for the same week as any date entered. I'm using the system settings for the first day of week.
For some reason I can get it to work unless the day selected is the first day of the week. In that case it always selects the monday of the previous week. For all other dates it works fine.
VB Code:
dMonday = DateAdd("d", -Weekday(dSelectedDate, vbMonday) + 1, dSelectedDate)
Receiving A Date From A Week Number?
Does somebody now what function or does someone have some code for receiving
a Date when my input value is a week number?
I will appreciate any help.
How To Get Week Number Based On Date
Hi,
I'm looking for code that can display week number based on date. The week number must based on calendar week number.
I need it the help urgent. Right now, my office block any microsoft website (which including msdn website )
Convert Week Number To Date Range
I need to convert a week number to a date range (i.e. the dates that would be from Sunday to Saturday for a week) Is there a function that can accomplish this?
Calculating A Date From Week Number & Year
I need to be able to calculate the date of every Monday depending on what week number/year it is.
For example is it possible to calculate the date (e.g. 20/10/2003) of a given day (e.g. Monday) when you only know the week number (e.g. 43) and the year (e.g. 2003)
If anyone can point me in the right direction, your help would be greatly appreciated.
Many thanks in advance
Jon
Reversing The Digits Of A Number/display The Day Of The Week For Any Date
1.)How do I write a VB function/procedure that reverses the digits of a given number? I don't want to assume the length (no. of digits) of the number. That is, the user may input a 2-digit, 3-digit or number of any length (less than 6 digits).
2.) How do I write an event procedure to display the day of the week for any given date. What functions should I use?
This is not my homework. My exams are knocking on the door and so I was solving earlier year's question papers. I am stuck, so please help!
How To Get The Week Of A Particular Month And Then Search For The Date In That Week?
Hey guys, I have a problem here. I am at da moment, trying to code the form where I can calculate the week's Statistics of the booked dates in the file.
All Im tryin to do is the user has access to the months 1 - 12 after he clicks on the combo box. after that he can choose the first second or last week from another combo box after this he will be shown the no: of bookings done in that week.
I cant get it working. I got it to 2 work on the month and week by adding them to da combo. but not the process.
please help
Darkshade
*resolved * Converting Date To A Number
Hi All,
I know that you can convert a date into a floating point number
via a variant type ( or so microsoft help says).
apparently, the left side of the '.' are the days and the right side is the time.
But I can't seem to do it.
What I want to do is to set up an expiry date of say:
12 june 2003 and convert it to a number eg: 2134
Then in my software, I just say : if int(Date) > 2134 then expired=true
Can anyone help me out on this?
I'd rather not use Datediff, I want to eliminate all date formatting etc..
Thanks in Advance
Chris B
*Resolved* Date(String) And Number(Long) Format
How can I pass a date and number(long) in this format using VB code :
(1, '07/02/2003')
VB Code:
dim field_a as Longdim field_b as String ( " & field_a & "," & " & " ' field_b ' " & " )
I need to pass the date in the above format with a single quotes.I tried above code ;but at runtime,it says :Syntax Error"
Thanks in advance
Week Number
How can I retrieve the week number of the current date using VB6?
Getting Number Of The Week
I have a date in a labelbox like:
label1 = date
Now I can put automatic the month like:
label2 = month(date)
I also want to put the number of the week from that month and I have no clue, any idea?
How Can I Get The NUMBER Of Day Of Week?
Hello everybody!
to get a day of week - no problem:
VB Code:
strDate = Format(Date, "dddd", vbMonday)
But how can I get the NUMBER of day of week, for example in this case: WEDNESDAY = 3
i.e. how can I get "3" with function Format?
And could you be so kind to inform me - where it is possible to look all probable parameters (dd, ww, yyyy...), There are not not much listed parameters in help
best regards
Baloo
Week Number
Does it exist a function that returns the week number for a given date?
Thanks in advance.
Rgds.
Week Number
How to determine the week number is the current month ?
I'd like to know for example if this week is the first, second, third... of the current month?
Thanks for your help )
Week Number
Can someone please give me the syntax to get the current week number IRRESPECTIVE OF LOCAL SETTINGS. Going up the wall on such a simple question.
Need The Week Number.
I need to be able to know what week of the year it is. Also the prog I'm working on operates on "block" weeks. I was told "this is how it's always been done" I'm sure you can relate. Basically. If its week 1 that's fine. If it's week 2 the it's block week 1. If it's week 4 the it's block week 3. Confused yet. I basically need to know the week number but it must be the odd numbered week.
Thanks
Dave
There are 10 types of people in the world: those who understand binary, and those who don't.
Edited by - dcb007 on 2/1/2007 7:52:08 AM
Week Number Of Month
Hi,
Can anybody tell me how I could get the number of weeks in a month, starting from day 1 of the month with Friday as the weekend?
Thanks
How To Find Week Number?
I am trying to calculate the week number of a given date. I am using:
Code:
=ROUNDDOWN((K3-L2)/7,0)
where k3 is the date in question
and L2 is a cell with the first day of the year (eg 01/01/2004)
This works, but what I would really like is some way of generating the value in L2 automatically.
So, the problem is this, how can I automatically return a date that represents the first of january of the current year, without using VBA?
Any ideas?
Finding The Week Number
I'm trying to find a way to find out what number in the year a certain week is.
For example this week (beginning - 26th July) is week 31 this year.
I don't want to get into writing a whole load of code to calculate the number of weeks up to a certain point.
Does anyone know of a simple way to do this?
Number Of Week In A Month
Hi!
Is there a function that would tell the number of a week within a month? Or number of days in a month?
I need to tell whether the specific weekday is the first, second,.. or last in a specific month.
Any ideas?
Bostjan
Caliculate Week Number VB 6.0
Hi,
How can we caliculate the week number in month (based on uk zone) in vb?
For example today date is 08/12/2006.
In which week we are now?1st or 2nd
Any idea thanks
Week Number Of Month
Hi,
Can anybody tell me how I could get the number of weeks in a month, starting from day 1 of the month with Friday as the weekend?
Thanks
Week Number Question...
Does anyone know how to accurately calculate evey calendar week number of a given year (with the week starting on a Sunday)? I have tried multiple solutions but none have been 100% perfect i.e. it calculates some years as having a week 53.
Many thanks
Number Of Week Problem
i have table named AUFT and column TERMIN - i wanna copy to another table all records but grup by number of week and i have no idea how to make this
i have also textbox where i give number of week and program taken 10 up numbers (weeks) from given in textbox1 so i must create in my NEWTABLE 10 columns and give him name from text1.text (week) to 10 Up next group :.
i know its somethin call "ww" for weeks :
sql = "SELECT * FROM AUFT INTO NEWTABLE FROM AUFT..."
Edited by - Krzysztof.Z on 6/3/2004 8:14:03 AM
Week Number Of Month
Hi,
Can anybody tell me how I could get the number of weeks in a month, starting from day 1 of the month with Friday as the weekend?
Thanks
Finding The Week Number
Given a date, is there a simple way to return the Week Number of the year ?
eg, January 1,2,3 is in week 1 , January 5,6,7 is in week 2. May 31 is in week 23 June 1,2,3,4 is also in week 23
Many thanks!
Function Return Week Number
Hi everybody,
I want to know in Vb 6.0 whether the function to return the number of the week of given date in a specified month ? I used the DatePart function, but It seemly returns the number of the week of the year.
Example: DatePart("ww",#4/3/2004#) ---> It returns 14 weeks of the year 2004
But the result which I want to is 1st week of the April.
Thanks to read !
Daets/Week Number Question ....
Hooray ... everything is back to normal. Now I can stop reading manuals and go back to being lazy
My question is this :
I have a string date in the format YYYYMMDD. I want to know the week number (not financial) for this date. How ?
Do I have to fart around a bit, or is someone gonna show off and give me a 2 line answer ?
I should know this really, but I HATE playing with date formats, adn want to test how long it takes for a response before I have to start with those 'book' things again
Cheers guys.
The Day Of The Week Corresponding To A Date
Hey. I'm sure this is easily done, but if I get a month and a year, how could I be able to figure out which day the first of said month fell on? For example, if I were to receive November, 2006, I'd want to know that Novumber 1st falls on a Wednesday.
Date (week)
I have a field in my database and want to update this field with a value
choosen in a combobox.
An example :
date = 10.08.2004
cboweek.Text = "5" (35 days)
newdate = 14.09.2004
Can I use DateAdd ?.......how ?
Can someone pls help me with this code ?
Day Of The Week From Date
I'm sorry if this has been asked before but I have had a hard time finding it with the search.
I need the basic algorithm to find the day of the week based on the date. I have it working for the 1900s but not for al years. Im not asking for the code just the basic algorithm if anyone knows it or knows of a site that has an example.
for example if given 03 12 03 it would return Wednesday
Thanks!
James
Date To Day Of Week
Hello,
I have a very important procedure to add to my program and I can't figure out how to do it.
I simply want to convert a given date E.g. 11/06/2003 (dd/mm/yyyy) to the day it corresponds in this month for this year. I.e in this case Wednesday.
Anybody has an idea please.
Thanks
Mark
Get First And Last Day Of The Week Using Date
Hi All,
First of all, i would like to thank everyone for being with vbforums.
It's a great place to be and have so much information available.
I am writing an automated report generator and i need to tell it to run reports at the end of each week for the week before
I have already managed to get the 24 hour reporter working and the monthly reports.
but for some reason i can't work out the weekly thing.
Please, I am open to any suggestions.
Elpower
Getting The Date Of A Week
ok, here's a challenge for you! then again it might be piss easy, but it's extremely hot in the office, and i can barely concentrate on anything
say i had a combobox with a list of week numbers (ie. 1, 2, 3,.....52), how could i select a week number and get the date that week started? so if i selected week 1, it would return 01/01/01, and week 2 would return 08/01/01, etc.
thanks
Getting Date Of The First Day Of The Week
thanks i also just came up with this, although i haven't tested it properly yet:
VB Code:
Public Function Blah() Dim i As Integer For i = 7 To 1 Step -1 If (Format(DateAdd("d", -i, Date), "ddd") = "Mon") Then Blah = DateAdd("d", -i, Date) Exit For End If Next i End Function
i think i'll do it your way though, looks safer
|