Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Calender Control - Date YES But Which Week ....


Hi there,

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.

Thanks aktell




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Display Date Range Based On Calender Week No
Hi guys,
I'm trying to think of a coding that will display the date range of a selected calender week no.

For example if the user selects week 32 on the calender, then the program should return the date range, 24/09/01 - 30/09/01.

Have anyone got any idea of how to do this. Pls guys... Help me...

Thanks a lot.

Calender Control Current Date
Hello,

I have a Microsoft Calender control embedded in a form. I would like the control, when opened, to display the current date. Is there a way of setting the value of the calender control with the current date. Any help would be appreciated. Thanks,

Hellboy

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?

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

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

Finding The Date Of The 2nd Day Of The Week Of Week 44
how can i find the above?

e.g i want to find for weeknumber 44 what is the date of monday

thnks

*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)

Date From Calender
Dear Guys,

In a form, i want to pick a date from calender. User should not type any date, and that date to be stored in access field...

Please guide me !!

Calender Date Help Plz!!!
Hey guys,

I am currently working on a database with the ability to input dates with clicks on the built in calender.

There are rules which the program must abide by for this program when the user clicks on a date.

1. - an input date must be 7 days in advance
2 - an input date must also be within 2 months.

Here's my code for this feature:


VB Code:
Private Sub Calendar1_Click()datetxt.Text = Calendar1.Valuedate1 = datetxt.TextIf date1 < (date + 7) Then    MsgBox "Please book at least 7 days in advance"If date1 > (date + 60) Then    MsgBox "You cannot book more than 2 months in advance"End IfEnd If


However, the above code does not work!
NO matter where i click on the calender, the msgboxes never come up!!

Thanks for any help!!!

Computing Date From Mix Of Date &amp; 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.

Date Format For Calender
hi folks,
How do i setup the format for the date when i invoking a VB calender instead of using the PC's default format? will it be only for the session or will it change my PC's default format as well?
Your kind help is appreciated.

regards

Calender/Date Calculation Question...
Hello All,
Hope I state this in a way that makes clear what I'm trying to do. This is more of a pure programming question.

Do any of you know an algorithm which will yield all the possible dates when the given criteria is, say, the second Tuesday of April?? In the example, I would need to know all the days in April which could be the second tuesday (5,6,7 - like that). I know there are seven of them. I know I can LOOK at all the possible April's and figure it out, but, now I'm trying to code it.

Sidebar: Is Thanksgiving defined as the 4th thursday in November or what??

This is for an Almanac program I'm working on.

Thanx In Advance,
->Noah

Calender Component - Date Into Textbox
Hi, using the VB Calender Component how do I get the selected date from the calender into a textbox?

Thanks

Date/Time And Calender Question
I have an extraction routine that is run based on a start and stop date. I know how to set the current date to be the stop date however I would like to set the start date to be the last time an extraction was made plus 1 day......Can this be done?

How To Connect A Calender To Computers Date &amp; Time
Hello all,
I was looking for a solution on how to connect the calender to the date and time of the computer, any suggestions?
thanks in advance

_vb_

Setting Calender Selection To Current Date
Hi All,
When I load up my calendar control at runtime, the date that is automatically selected is the date when I first created the project.
How can I set the selected date on the calendar to the current date?. Every method seems to be read-only.
Rgds
Ray

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

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).
Tanks!!!

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
Hi everybody

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???

Fzz

Get The Date Of The First Sunday Of The Week
Hi,

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 ..

Thanks,
ksk

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..

regards pragash..

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?

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

End Function


How can I translate date to week(with the year of course)?

Date Functions(beg. And End Of Week)
Is there a date function(s) that will return the first and last date of the week based on a date that I give it?

Week Number --&gt; 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)

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?
Thanks.

Getting A Date From A Week Number
Is there a function in VB to return Month/day from a week number - where current year is also entered ?

Give Me The Date From The Week
Is there a way to give me Sunday's date on the 11th week of this year in this formatt?

dd/mm/yyyy

thanks

Type In Date Get Out Week No.?
Simple Form:
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 To Get Week Days From A Date In Vb6
Dear,

I have to change the days of the week from satureday to sunday and sunday to satureday. Is there any function which can impliment it.

regards.

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
 - - - - - - - - - - - - - - - - - - - -

Date Picker...Time And Hours Can Be Customised But Click Should Show Calender...
I am really thankful to thsi forum for timesly and accurate information...


I had developed an application where in user wnat the time in Hours (with am and pm e.g. 9 am, 1 pm , 4 pm etc)

I can customise the dtPicker that will show the Hours with am and pm with 'hh tt'

But when user clicks on DtPicker, its shows a clendar...can we show the click or any thing relevan to time ? and definitely not the calendar...which is irrelevant

with regards
Vikas Tahavale

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.

Thanks

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


Dale S

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.

Select Week, Display Date... How?
How do I do in such a way where i choose the week and the date within that week is displayed?

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.

Regards.

Obtaing A Week Number From A Date
How can i obtain the week number from a given date.

At present this is week 5.

Any help would be appreciated

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.
Hi,

How can i delete a record using timer in a specific date like a record is 1 week older.

ex:

delete from table where date=""

Can any one help me.

Determine Date Out Of Week And Year
Hi,

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?

Copyright © 2005-08 www.BigResource.com, All rights reserved