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 9070881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:47:31+00:00 2026-06-16T17:47:31+00:00

This need is a little strange, and I can do it in C#, but

  • 0

This need is a little strange, and I can do it in C#, but can’t seem to get the expression syntax right for Report Designer.

I want to set default Start and End parameters for a report. To do this, I need “date only” values for the first Saturday of a month, and the Friday date of the last week of that month. This means the latter value can actually be in the next month. So for 2012, my values would look like this:

StartDate: 10/06/2012
EndDate: 11/02/2012

StartDate: 11/03/2012
EndDate: 11/30/2012

StartDate: 12/01/2012
EndDate: 01/04/2013

I’ve been working with conditional statements using Month(), Weekday(), WeekdayName, etc. but not having good luck. Has anyone done something like this?

  • 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-16T17:47:31+00:00Added an answer on June 16, 2026 at 5:47 pm

    You probably don’t need any hefty conditional statements. If you’re doing it to simulate loops and other imperative programming features, it may be easier to create a function in Custom Code to do it.

    An alterantive is to look for an algorithm for the particular calculations you’re doing. For example this answer can be a great basis for getting your needed dates, be it with a little adjustment. Here’s how it would work for “The first Saturday of this month”:

    1. Day of the week for the day 1 of this month:

      =Weekday(DateAdd("d", 1 - Now().Day, Now()), FirstDayOfWeek.Sunday)
      
    2. How many days should we add to that first day of the month:

      =7 - Weekday(DateAdd("d", 1 - Now().Day, Now()), FirstDayOfWeek.Sunday)
      
    3. So the date for the first Saturday of the month is:

      =DateAdd("d", 
           7 - Weekday(DateAdd("d", 1 - Now().Day, Now()), FirstDayOfWeek.Sunday),
           DateAdd("d", 1 - Now().Day, Now())
          )
      

    There are probably even smarter ways to do this, though VBScript expressions are a wee bit limited. The example above can be tweaked to get the “Friday of the last week of the month” as well.

    Bottom line: the (indirect, but generic) answer to your question is to think about the algorithm to get to your wanted date (as declarative as possible, because you can’t do loops and stuff in Expressions easily).

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

Sidebar

Related Questions

I know I'm close to figuring this out but need a little help. What
I need a little help getting this script doing what I want it to.
Maybe this sounds a little bit crazy, but I need to come up with
This is a little bit of a strange question, but I have a bunch
So this is a little bit of a strange question, but it could be
Maybe seems little bit strange but I need e-commerce/web shop/cart system for just one
This need may sound a little convoluted, and if so, then I am open
I need a little help with this.. I need to take only the numbers
I'm quite new to this Git thing and need a little help. I recently
i am new to this core graphics or cv . I need a little

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.