Results 1 to 2 of 2

Thread: Obtaining Date Values

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    London, England


    I have two fields in an Access Database:

    StartDate EndDate
    1/12/99 6/2/99

    Is there any way I can assign a variable to the values of these two fields and all of the dates in between.


    I want to end up with something like:

    sDate1 = 1/12/99
    sDate1 = 2/12/99
    sDate1 = 3/12/99
    sDate1 = 4/12/99
    sDate1 = 5/12/99
    sDate1 = 6/12/99

    If this is possible how could I code it in VB ?

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Red Wing, MN, USA


    You can't have a single variable represent multiple values, the closest you can get is to use an Array, but, if you know the Begin and End Values, just use those in your Expressions, ie.
    If dSomeDate >= dBeginDate And dSomeDate <= dEndDate Then 
        'The Date "dSomeDate" Falls in the Range of Dates Represented by dBeginDate and dEndDate
    End If
    Aaron Young
    Analyst Programmer

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