Find week start date and weekend date from current date

Posted on 2006-04-26
Last Modified: 2008-01-09
If I select current date as  26/Apr/2006 it will give me  week start date
As  23/Apr/2006 and weekend date as 29/Apr/2006
If I select current date as  31/May/2006 it will give me  week start date
As  28/May/2006 and weekend date as 03/Jun/2006
    LVL 44

    Accepted Solution


    StartDate= DateAdd("d", 1 - DatePart("w", Now), Now)
    EndDate = DateAdd("d", 7 - DatePart("w", Now), Now)

    Tim Cottee
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]

    debug.print dateadd("d", 1-datepart("w", now), now)
    debug.print dateadd("d", 8-datepart("w", now), now)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now