Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Posts
    2

    Unanswered: Getting the latest date from 4 different date fields

    Hi,

    I was wondering if someone could help me write this query. I have one database with a number of records. In each of this record, I have an ID # and 4 different date fields. I want to compare each of these 4 dates (date1, date2 etc...) against each other. At each comparison, I want to store or retain only the latest date out of these 4 in a separate field called 'latest date'.
    example:
    date1 is 040101

    date2 is 040315

    date3 is 031001

    date4 is 021101

    so latest date field should be then 040315. Please let me know how I would store or insert also the last date in 'latest date' field.

  2. #2
    Join Date
    Sep 2004
    Location
    Charlotte, NC
    Posts
    164
    Here is an article from the Microsoft Knowledge Base that has a solution for a problem similar to yours. If you use it, you would need to dimension your fields as a Date rather than an Integer.

    http://support.microsoft.com/default...b;en-us;209857

    TD

Posting Permissions

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