Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Max date for specific client Post Reply Post New Topic
Author Message
sanchezgmc06
Senior Member
Senior Member
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Quote sanchezgmc06 Replybullet Topic: Max date for specific client
     Posted: 24 Sep 2014 at 8:48am
Hello I need to get the most recent assessment completed for each client. So I am thinking the max date function should do it however when I do

Max ({assessment.date})

in my command statement I get the max date for all records and not the max date for the {assessment.clientid}

help

Edited by sanchezgmc06 - 24 Sep 2014 at 8:49am
IP IP Logged
sanchezgmc06
Senior Member
Senior Member
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Quote sanchezgmc06 Replybullet Posted: 24 Sep 2014 at 10:21am
I figured it out

SELECT
PSMC.recom_sft,
PSMC.summary_sft,
PSMC.assess_date,
PSMC.CLIENTID

FROM
SYSTEM.psych_assmt PSMC

WHERE
PSMC.CLIENTID = '???????'
AND
PSMC.assess_date = (SELECT MAX(PSMC2.assess_date)
               FROM
               SYSTEM.psych_assmt PSMC2
               WHERE PSMC.CLIENTID = PSMC2.CLIENTID)


Edited by sanchezgmc06 - 24 Sep 2014 at 10:21am
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum