Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8769391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:20:00+00:00 2026-06-13T17:20:00+00:00

In VBScript, how can I get the Monday of the current week, assuming a

  • 0

In VBScript, how can I get the Monday of the current week, assuming a week is Mon-Sun and not Sun-Sat?

The following code returns the Monday when a week is Sun-Sat, so it’s close but not quite right:

Private Function getMonday(d)
    getMonday = DATEADD("d", 2 - WEEKDAY(d), d)
End Function

How can I do this without changing any LCID settings?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:20:03+00:00Added an answer on June 13, 2026 at 5:20 pm

    Weekday takes a second argument to specify the first day of the week.

    http://msdn.microsoft.com/en-us/library/t51x9wtx(v=vs.84).aspx

    So DateAdd("d", 1 - WeekDay(d, 2), d)

    I didn’t test this to make sure my logic is correct. But the technique should work for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't get the following function in VBScript to work. I am trying to
I wrote vbscript inside my html file for my site and I can't get
Basic doubt...If QTP generates vbscript code as we record actions, can't we directly write
I get the following error: Microsoft VBScript runtime error '800a0046' Permission denied When running
Can you please tell me why I am getting the following error? VBScript runtime
How can I get the description from an WMI class using vbscript? I found
Inside a classic asp page, I'm told that you can use vbscript or jscript.
How can I pass a parameter from batch to vbscript? My batch script sends
Can anyone recommend a free VBScript compiler?
How can I make my class library STA for use with CreateObject in VBScript?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.