Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MIN MAX Date (2000)

    I loop txt file with this part of code:

    ...
    Do While Not EOF(1)
    Line Input #1, curLine
    RIGA_LETTURA = Mid(curLine, 30, 10)
    'inputLines.Add curLine
    Loop

    Close #1
    ....

    when the loop is finished is possible to store in var MAX_DATA and MIN_DATA the min and the max date found from the loop?
    in this case min is 09/12/2008 and max is 15/12/2008
    Peraoph using an array to store the date and extract the min and max????

    part of text file:
    10/12/2008
    09/12/2008
    09/12/2008
    09/12/2008
    09/12/2008
    12/12/2008
    12/12/2008
    12/12/2008
    12/12/2008
    09/12/2008
    15/12/2008
    10/12/2008
    10/12/2008

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MIN MAX Date (2000)

    Add the following lines at the beginning of your procedure:

    Dim COR_DATA As Date
    Dim MIN_DATA As Date
    Dim MAX_DATA As Date
    MIN_DATA = #12/31/9999#

    and add the following lines below the line RIGA_LETTURA = Mid(curLine, 30, 10):

    COR_DATA = CDate(RIGA_LETTURA)
    If COR_DATA < MIN_DATA Then
    MIN_DATA = COR_DATA
    End If
    If COR_DATA > MAX_DATA Then
    MAX_DATA = COR_DATA
    End If

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MIN MAX Date (2000)

    work perfect!
    Tks.

Posting Permissions

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