473,326 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How do I find the date of this Saturday?

I'm a programming neophyte so needless to say I need some help on some
VB scripting.
I need to create some code to find what month it will be this coming
Saturday. I also need to do the same for the week # of the month this
Saturday. And finally, the Year of the month this Saturday.
Could someone help me with this?
Thanks
n8

Jul 17 '05 #1
6 6764
> I'm a programming neophyte so needless to say I need some help on some
VB scripting.

I need to create some code to find what month it will be this coming
Saturday. I also need to do the same for the week # of the month this
Saturday. And finally, the Year of the month this Saturday.

Could someone help me with this?


You can calculate Saturday's date this way

SaturdaysDate = DateAdd("d", vbSaturday - Weekday(Date), Date)

Then use VB's Month and Year functions to get the month and year for
that date. To get the week number, you will need to use VB's DatePart
function. You can look these up in the help files to get more
information on them.

Rick - MVP

Jul 17 '05 #2
> I'm a programming neophyte so needless to say I need some help on some
VB scripting.

I need to create some code to find what month it will be this coming
Saturday. I also need to do the same for the week # of the month this
Saturday. And finally, the Year of the month this Saturday.

Could someone help me with this?


You can calculate Saturday's date this way

SaturdaysDate = DateAdd("d", vbSaturday - Weekday(Date), Date)

Then use VB's Month and Year functions to get the month and year for
that date. To get the week number, you will need to use VB's DatePart
function. You can look these up in the help files to get more
information on them.

Rick - MVP

Jul 17 '05 #3
Thank you. That seemed to work. Can you point me to some reference
matrial so I can read up on the type of functions as described above?

Thanks again,
-N8

Jul 17 '05 #4
Thank you. That seemed to work. Can you point me to some reference
matrial so I can read up on the type of functions as described above?

Thanks again,
-N8

Jul 17 '05 #5

"N8tor" <n8******@gmail.com> skrev i en meddelelse
news:11**********************@z14g2000cwz.googlegr oups.com...
Thank you. That seemed to work. Can you point me to some
reference
matrial so I can read up on the type of functions as described
above?


Yes, F1 ;-)
--
/\ preben nielsen
\/\ pr**@post.tele.dk
Jul 17 '05 #6

"N8tor" <n8******@gmail.com> skrev i en meddelelse
news:11**********************@z14g2000cwz.googlegr oups.com...
Thank you. That seemed to work. Can you point me to some
reference
matrial so I can read up on the type of functions as described
above?


Yes, F1 ;-)
--
/\ preben nielsen
\/\ pr**@post.tele.dk
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Matt | last post by:
My ASP page allows the user select the date, and it will display the report during that week of that date. My question is when the program query database, I need to know the beginning date and...
7
by: Mick White | last post by:
According to the Safari browser the world began on "Fri Dec 13 1901 15:45:52 GMT-0500", but I need to be able to get around this limitation. I am interested in dates from 1500 to 1901, as far as...
38
by: | last post by:
I have a script... ----- <SCRIPT language="JavaScript" type="text/javascript"> <!-- function makeArray() { for (i = 0; i<makeArray.arguments.length; i++) this = makeArray.arguments; } ...
20
by: Laguna | last post by:
Hi Gurus, I want to find the expiration date of stock options (3rd Friday of the month) for an any give month and year. I have tried a few tricks with the functions provided by the built-in...
7
by: AdityaK | last post by:
Is there a way to find Weekend date for a given date using a DB2 query? I see that there are scalar functions such as DAY, DAYOFMONTH, DAYOFWEEK,etc are available...but couldn't find one to get a...
3
by: Craig Bates | last post by:
Hi Guys I have recently been learning SQL from a book whose examples used the Oracle engine. I have now made an Access database containing information for English Football fixtures. I am using...
2
by: Jerry | last post by:
Given a selected date, how do I find the date of the Sunday and Saturday of the week that that date is in? Thanks! Jerry
5
by: Des | last post by:
I have to do an events calender for a church. The events display will be limited to that week. If someone went in today Wed 24th I want to display 21st to 27th. I dont want any code samples, just...
5
by: Polaris | last post by:
Hi Experts: Using C#, knowing today's date, how to get the date of NEXT Tuesday? For example, if today is 2007-04-26, I'd like to get the date of next Tuesday which is 2007-05-01. Thanks in...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.