Finding What Day Of The Week A Date Is
I was wondering how you can find out what day of the week a date is. For instance, I know 4/16/01 is a Monday. Is there anyway for VB to tell me what day of the week any date I feed it is?Whom shall I fear?
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:
Private Sub getWeekNumber()
'This fantastic bit of code returns the week number
Dim iNumberOfTheWeek As Integer
iNumberOfTheWeek = DatePart("ww", Now())
But now I want to find the date range that any given week covers.
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.
Week Number And Week Ending Date In VB 6
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)
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:
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?
Finding The Day Of The Week ??
My application works with a long list of dated data records.
I have a variable which holds the date of the current record.
(I can make the var. a string or a Date type if necessary)
How can I find the "Day of the week" for any given date
in the date variable.??
What I'm trying to do is have the program react a certain
way if the date encountered is a Monday.
(Some of the dates may be 10 years back.)
Any DATE experts out there ?
Finding The Day Of The Week
Does anyone have a simple method of working out what day of the week it is from the current date??
The Day function doesn't help much.....
Any help appreciated.
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?
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
*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.
dMonday = DateAdd("d", -Weekday(dSelectedDate, vbMonday) + 1, dSelectedDate)
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.
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.
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
Date To Day Of Week
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.
Get First And Last Day Of The Week Using Date
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.
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.
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:
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
How To Know The Week Of A Date?
Hi, can any body help me?
Is there a function or whatever wich can tell me the exact week number from a given date (for example: 01/01/2001 is in week number 1).
Get Date From A Week Ago
Greetings and Salutations!
I would like to know how I can get a date formatted minus seven days from todays date and also one month prior.
Thank you for reading this and any help you can provide.
Date Of The First Day Of A Week
I want to know the date of the first day of a week.
Example: I choose a date : the 5th of MAY 2003.
I can have the week (between 1 and 52)
But I want the date of the first day of this week.
I can get the day (monday, tuesday...) and if I know how many days there are in the month I can move backward until the first day.
Is there a method faster and easier than this one???
Get The Date Of The First Sunday Of The Week
I will pass the week num ( 1/2/3/4/5) and week day(1/2/3/4/5/6/7)
for a date varaible.
I need to get the date of the first sunday or second sunday or first monday
or second monday of the month.
As per the parameters passed above , I need to get the date values.
Any VB functions to get this.
Pls let me know reg this ..
How To Get The Week No In A Year Given The Date
i would like to know , what functions that need to be used in order to get the week no in a year given the date..
i tried using the week(date) function but it does not seem to work..is there any other way i can solve this problem..tahnk you..
Date To Week Function
Here's a function that translates week to date:
Public Function StartOfWeek(txtWeekNo As String, txtYear As String) As Date
Dim TempDate As Date
TempDate = CDate("01/01/" & txtYear) - Weekday("01/01/" & txtYear, vbSunday) + 1
TempDate = TempDate + 7 * (txtWeekNo - 1)
StartOfWeek = TempDate
How can I translate date to week(with the year of course)?
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:
(I live in Denmark, and therefore the first day of the week is vbMonday)
Calendar Week To Date
Guys this is urgent! Please help.
I need to convert a calendar week no into a date (Saturday).
I did set the first Saturday of the year into a formula (as below). But the output is all Sundays.
sWeekEnding = DateAdd("d", ((rst2!CalendarWeek * 7) - 2), rst5!firstsaturday)
Please help. Is there any other formula that I can use?
Type In Date Get Out Week No.?
Textbox --- you get type in f.ex. 03.09.01 and you will get in msgbox the week no. in this case week 10 of 52 !
can anybody help?
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
- - - - - - - - - - - - - - - - - - - -
Determining What Week A Date Falls In
I have a small program that I am creating that will prompt the user to enter a date in the format mm/dd/yyyy. Is there anything built in VB that will allow me to find out which week of the year the day falls in. Im assuming that VB assumes that Sunday is the start of the week.
An example of what I am trying to do would be the following.
The user enters the date 01/05/2006. And the program would know that the date entered is in Week 1 of the year. I am trying to get this so that it will work moving onward for any year in the future.
Any ideas or starting points on where to begin with this.
Calculate Week Ending Date
can anyone tell me how I can calculate the End of week date?
I want to have a comb box that the user can pick a date, ( all Fridays date for the year)
I dont have a clue as how to do this
Test If A Date Is In The Current Week
I'm trying to make a little function that checks if the date in the database is in the current week and then if it is, I could add the entry on a listview.
Here's a concrete example of what I'm trying to do:
Let's say an entry has the date May 8th 2007. I want to test if Now is in the same week as the entry. (Now could be a date from May 8th to May 12th (can't go in the past naturally)).
Weeks start on monday too.
I've tried a lot of things to make it works, but I still didn't succeed, that's why I'm asking you guys...
If someone could help me with this I would really appreciate it.
Thanks in advance.
Calender Control - Date YES But Which Week ....
I'm trying to figure out if it is possible to use the Calender control and somehow when you click the date can also find the week of that date (say it's "date = week 32 of the 2006) just like in a dairy. If it has to be any other control fine, but I would prefer the Calender cntrol to work with.
Calculating The Week Beginning Date.
Hi, I'm using the MonthView control for the first time, what I want to do is calculate the week beginning date on startup and when a person choses a date, i.e. todays date being the 29/03/2006 I need to enter the week beginning date of 27/03/2006 into a text box. I then plan to use this date to load information from an excel spreadsheet to fill in the AM and PM slots for the person, showing them their whereabouts for that week.
so if they choose another date, say 07/04/2006 it would select the week beginning 03/04/2006. Hope that makes sense and someone can show me what to do.
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
About Date Record Is 1 Week Older.
How can i delete a record using timer in a specific date like a record is 1 week older.
delete from table where date=""
Can any one help me.
Determine Date Out Of Week And Year
Is there a function, or is it difficult to make a function, that receives 3 parameters (weeknumber, year and day) and determines the date belonging to that day. For example I want to know what date the friday in week 23 in 2003 will be. I pass these parameters to the function and it returns: "June 30".
Does anyone has suggestions an making such a thing?
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.
Day Of Week To Actual Date Dilema
I am working on a delivery service model. I have to deliver freight on certain days to certain stores. I have a table that has store information and what day of the week they should receive freight. Once the Truck is loaded I generate an email that the truck is loaded and ready for pick up. The problem I am having is to add the delivery date based on their Delivery day. For example
Store "ABC" gets deliveries every Wednesday.
I finish loading the truck today 04/23/04
I need something that will look at "Wednesday" as the delivery day in my store table and display a message saying that this will deliver on 04/28/04.
Anyway to do this???
All suggestions greatly appreciated
How To Get Week Number Based On Date
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 )
Week From Date (Financial Year)
Im trying to run a peice of code to do the following
Get the week number from a cell where 31/03/XX is the first day of the year.
And only goes up to 52 weeks then resets back to week 1 on the 53'rd week.
ANy help would be much obliged.
Edited by - Big Al Inc on 5/8/2007 7:56:42 AM