• Query for last record (Access 02)

    Author
    Topic
    #369911

    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

    Viewing 0 reply threads
    Author
    Replies
    • #583733

      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

      • #583782

        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

        • #583783

          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.

          • #583866

            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

    Viewing 0 reply threads
    Reply To: Query for last record (Access 02)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: