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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:09:20+00:00 2026-05-31T13:09:20+00:00

I need some assistance regarding to how to auto update StartDate and EndDate for

  • 0

I need some assistance regarding to how to auto update StartDate and EndDate for next execution. At this moment, I manually add the StartDate and EndDate in sql database and if I didn’t change the StartDate and EndDate, my report will be generating using same StartDate and EndDate. Appreciate if you all can give any idea or suggestion about that. Thanks.

static void Main(string[] args)
{
    DateTime start = System.DateTime.Now.AddMinutes(1);
    Schedule.PeriodicSchedules schedule = 
        new Schedule.PeriodicSchedules(start,
            Schedule.PeriodicSchedules.Frequency.Minutely);
    schedule.Elapsed += new System.Timers.ElapsedEventHandler(GenerateReport);
    schedule.Enabled = true;

    Console.ReadLine();
}

static void GenerateReport(object sender, EventArgs e)
{
    if (TypeOfReport == "BillingReport")
    {
        DateOfExecution = DateTime.Parse(strDOE);
        Schedule.PeriodicSchedules s = 
            new Schedule.PeriodicSchedules(DateOfExecution,
                Schedule.PeriodicSchedules.Frequency.Weekly);

        crRpt.Load(BillingReport);
        ReportLogin(crRpt);

        while (ThisReader.Read())
        {
            //StartDate and EndDate >>next execution?
            crRpt.SetParameterValue("@CollectionStartDate", StartDate);
            crRpt.SetParameterValue("@CollectionEndDate", EndDate);
            crRpt.SetParameterValue("@SpokeCode", SpokeCode);
        }
    }
    if (TypeOfReport == "ImageReport")
    {
        DateOfExecution = DateTime.Parse(strDOE);
        Schedule.PeriodicSchedules s = 
            new Schedule.PeriodicSchedules(DateOfExecution,         
                Schedule.PeriodicSchedules.Frequency.Monthly);

        crRpt.Load(ImageReport);
        ReportLogin(crRpt);

        crRpt.SetParameterValue("@CollectionStartDate", StartDate);
        crRpt.SetParameterValue("@CollectionEndDate", EndDate);
        crRpt.SetParameterValue("@SpokeCode", SpokeCode);
    }
}    
  • 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-05-31T13:09:21+00:00Added an answer on May 31, 2026 at 1:09 pm

    I manage to do it by call another method to auto update my DateOfExecution. Let me know if someone have another way. 🙂

    static void GenerateReport(object sender, EventArgs e)
        {
            if (TypeOfReport == "BillingReport")
            {
               ......
               DateOfExecution = DateTime.Parse(strDOE);
               Schedule.PeriodicSchedules s = new Schedule.PeriodicSchedules(DateOfExecution, Schedule.PeriodicSchedules.Frequency.Minutely);
               //weekly
               DateTime StartDate = DateOfExecution.AddDays(-7);
               DateTime EndDate = DateOfExecution.AddDays(-1);
               ..........
               UpdateWeekly(DateOfExecution, strReportType);             
            }        
        }
    
    static void UpdateWeekly(DateTime DateOfExecution, String strReportType)
        {
            DateOfExecution = DateOfExecution.AddMinutes(2);
            SqlConnection thisConnection = new SqlConnection(SQLConnection);
            thisConnection.Open();
            SqlCommand thisCommand = thisConnection.CreateCommand();
            //thisCommand.CommandText = "INSERT INTO dbo.Schedules (DateOfExecution)" + "Values('"+DateOfExecution+"')";
            thisCommand.CommandText = "UPDATE dbo.Schedule set DateOfExecution = '" + DateOfExecution + "' WHERE TypeOfReport = '" + strReportType + "'";
            thisCommand.ExecuteNonQuery();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need some assistance with a SQL query: the data looks like this: ID
I'm in need of some assistance regarding permutations. My problem is this: In our
Greetings. Need some assistance with creating a computed column on this table: USE [ScienceWorksSummary]
I need some assistance to approach this. I have created a UITabBarController where I
I need some assistance understanding how variables of a typedef work with structs /*This
Need some help to solve this. I have a gridview and inside the gridview
Need some help with this problem in implementing with XSLT, I had already implemented
Need some help gathering thoughts on this issue. Our team is moving ahead with
I need some assistance in Qt on Windows 7. It seems that Qt readyRead()
I need some assistance writing what should be a fairly basic .BAT file. I

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.