Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query for last record (Access 02)

    We have a client listing report that we want to add a text box that will display the last DateofService. The report is based on a query. I have not been able to figure out how to do that. Any help would be appreciated. Fay

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query for last record (Access 02)

    A little more detail would be helpful, but in the meantime, have you tried the DMax function? It seems that you would want the maximum of DateofService for the Client.
    HTH

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query for last record (Access 02)

    I tried DMax using the following =DMax("[DateofService]","Services","[ClientIdentification]"
    It gives me the last DateofService for the whole table.

    The database holds clients, staff, and service tickets for when the clients were seen. On the report I need to know when each individual client was last seen by a staff member.

    Thanks Fay

  4. #4
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query for last record (Access 02)

    You need to write the criteria portion (the third argument) of the function more specifically. Something like:
    =DMax("[DateofService]", "Services", "[ClientIdentification] = [Yourtablename].[ClientIdentification}")

    So that the DMax function is looking for the maximum DateofService for that specific ClientIdentification (not the whole table). Access Help has some examples which use the criteria argument in this way.

  5. #5
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query for last record (Access 02)

    Okay I admit it. I blew it. It was so simple that I am embarrassed. I was creating my form using a totals query. All I needed to was create a field called Last based on the DateofService field and set the Total row to Max. A piece of cake. Thanks to everyone who looked and those that responded to this message. Fay

Posting Permissions

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