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

    Extract min and max dates from table (2000)

    I wnat to extract the MIN and MAX date in rset PROVA2 and store the value in var_MIN and var_MAX?
    i have maked this query but have sintyax error:

    Set OggettoRecordset = OggettoConnessione.Execute("SELECT Cdate(PROVA2) AS DATA FROM " & FOGLIO & " ORDER BY Cdate(PROVA2) AS DATA DESC")

    naturally other way are welcome.

    Note:
    - FOGLIO is the name of the table(this var is set String)

    - The date in rset PROVA2 are text similar
    12/01/2008
    01/01/2008
    03/12/2007
    ...

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Extract min and max dates from table (2000)

    I believe you should take the as data out of the order by as:

    Set OggettoRecordset = OggettoConnessione.Execute("SELECT Cdate(PROVA2) AS DATA FROM " & FOGLIO & " ORDER BY Cdate(PROVA2) DESC")

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

    Re: Extract min and max dates from table (2000)

    NICE! work now...
    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
  •