Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2011
    Location
    Corpus Christi, TX
    Posts
    26

    Unanswered: Query Question - Display First Date

    How can I find the first date if the date is split into a year and month column?

    I thought of using the Min function, which would work for the year column, but it would probably just return a 1 everytime in the month column.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    SELECT TOP 1
           yearcolumn
         , monthcolumn
      FROM daTable
    ORDER
        BY yearcolumn ASC
         , monthcolumn ASC
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Oct 2011
    Location
    Corpus Christi, TX
    Posts
    26
    Thanks r937.

Posting Permissions

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