Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Calculation Question

Posted on 2002-06-26
3
Medium Priority
?
150 Views
Last Modified: 2010-05-02
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
Comment
Question by:baddogi
  • 2
3 Comments
 
LVL 38

Expert Comment

by:PaulHews
ID: 7111573
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
 
LVL 38

Accepted Solution

by:
PaulHews earned 600 total points
ID: 7111584
eg>

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

end if
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7111647
this is a duplicate of http://www.experts-exchange.com/visualbasic/Q_20316525.html.

Please ask for deletion
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month12 days, 10 hours left to enroll

971 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