Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

Calculation Question

I need to call a SQL SP with this following idea:

Start January 10th
Run once every 2 weeks until January 10th

I don't know how to code VB for this.  I know how to code the following:

 Do While frmmain.Caption = "Employee Time Tracking Tool"
    DoEvents
   If Hour(Now) = 6 And Minute(Now) = 35 Then

    Set qy9ActiveConnection = conn1
    qy9.CommandType = adCmdStoredProc
    qy9.CommandText = "sp"
    qy9.Execute
0
baddogi
Asked:
baddogi
  • 2
1 Solution
 
PaulHewsCommented:
You don't really want to run the program 24/7 just to run a procedure every two weeks.

Use task scheduler to run every week.  When it runs, just check if it's a valid week to run it.
0
 
PaulHewsCommented:
eg>

if datediff("w", #jan 10, 2002#, date) mod 2 = 0 Then
  ..run procedure

end if
0
 
Éric MoreauSenior .Net ConsultantCommented:
this is a duplicate of http://www.experts-exchange.com/visualbasic/Q_20316525.html.

Please ask for deletion
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now