+ Reply to Thread
Results 1 to 2 of 2

Month VBA edit

  1. #1
    Registered User
    Join Date
    01-29-2007
    Posts
    10

    Month VBA edit

    Hello all,

    I am very new to VBA, and my boss gave me a very simple assignment to do. Basically, right now the code is pulling data for forecasts for the following 10 days, and the code is the following:

    WHERE (((dbo_ACTUAL_HDD_DAILY.DATE)>=Now()-1 And (dbo_ACTUAL_HDD_DAILY.DATE)<Now()+9)

    All he wants modified is to pull data for the entire current Month (Ex. if it is in the middle of July, he would want the data from July 1-July 31, or if February from Feb 1-Feb 28) It would be nice to do this without having to change the VBA every month.

    Thanks for the help, I know its really simple but I hope I will get the hang of this eventually.

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by VBA Beginner
    Hello all,

    I am very new to VBA, and my boss gave me a very simple assignment to do. Basically, right now the code is pulling data for forecasts for the following 10 days, and the code is the following:

    WHERE (((dbo_ACTUAL_HDD_DAILY.DATE)>=Now()-1 And (dbo_ACTUAL_HDD_DAILY.DATE)<Now()+9)

    All he wants modified is to pull data for the entire current Month (Ex. if it is in the middle of July, he would want the data from July 1-July 31, or if February from Feb 1-Feb 28) It would be nice to do this without having to change the VBA every month.

    Thanks for the help, I know its really simple but I hope I will get the hang of this eventually.
    Hi,

    in Tools, Add-ins is an Analysis Toolpack, which contains an EOMonth formula, but I don't think this is directly available to VB.

    One method is
    Please Login or Register  to view this content.
    and use mydate in place of your <Now()+9

    hth
    ---
    Si fractum non sit, noli id reficere.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1