Find Earliest Date no-brainer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Keith Wilby

    Find Earliest Date no-brainer

    How do you find the earliest of a set of dates in a field using a query? I
    thought using "min" in a totals query would work but it seems to treat the
    date like text. I feel a forehead slapping moment approaching ...

    TIA - Keith.

  • Fred Zuckerman

    #2
    Re: Find Earliest Date no-brainer

    "Keith Wilby" <here@there.com wrote in message
    news:48d263fa$1 _1@glkas0286.gr eenlnk.net...
    How do you find the earliest of a set of dates in a field using a query?
    I thought using "min" in a totals query would work but it seems to treat
    the date like text. I feel a forehead slapping moment approaching ...
    >
    TIA - Keith.
    Well, if the field/column you are using is formatted as a string and not as
    a date, then try changing your "min" expression from:
    [fieldname]

    to:
    cdate([fieldname])

    or:
    format([fieldname], "mm/dd/yyyy")

    Fred Zuckerman


    Comment

    • Salad

      #3
      Re: Find Earliest Date no-brainer

      Keith Wilby wrote:
      How do you find the earliest of a set of dates in a field using a
      query? I thought using "min" in a totals query would work but it seems
      to treat the date like text. I feel a forehead slapping moment
      approaching ...
      >
      TIA - Keith.
      What is it showing? The max? Something inbetween? Maybe provide your
      SQL...perhaps you have some filter in the query...or if you are using a
      subquery perhaps that limits the list as well. IOW, please verify all
      "tables" the query links to as inner joins shouldn't be left joins or
      that the "tables" are queries that filter records.

      Comment

      • Keith Wilby

        #4
        Re: Find Earliest Date no-brainer

        "Keith Wilby" <here@there.com wrote in message
        news:48d263fa$1 _1@glkas0286.gr eenlnk.net...

        I should add that it's an Oracle table and the data type is "Date".

        Comment

        Working...