Results 1 to 2 of 2

Thread: Change System Date?

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    46

    Change System Date?

    I know, the first thing you're going to say is "Why would you be doing that?".

    I have an app that extracts data daily from multiple databases and writes to an excel file. We noticed, after running it every day since Jan '04 that some of the data isn't right.

    I want to add to my app so after extracting the data and writing to the excel file, it will change the system date to the next day until now.

    So I'll start the app with my system date as Jan/01/04 and it will go through each day for me, just trying to avoid sitting here changing my system date after each time the app has run (manually).

    Thanks.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    I don't understand why you need to set it, but here you go anyway:

    To set a specific date:
    VB Code:
    1. Date = "22 April 2004"   'if this doesnt work you may need to use "22/4/2004" or "4/22/2004"

    To increment the date by one day:
    VB Code:
    1. Date=Dateadd("d",1,Date)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width