Hello,
I am trying to pull information from SQL that shows me the following:
Case Number "CASE_ID"
Case Note "CASE_DECR"
Case Note Added Date "DATEADDED_DTTM"
My report keeps coming out with duplicate case numbers because there are multiple case notes in each case. I want the report to show me only the "Newest" case note. (Only one Case number per case note)
I think I have the SQL Statement down but it doesn't work in Crystal. Am I on the right track? Thank you for the help!
SELECT TOP 1 DATEADDED_DTTM,CASE_ID FROM TABLE_NAME
WHERE CASE_ID IN (SELECT DISTINCT CASE_ID FROM TABLE_NAME)
ORDER BY ADDED_DTTM DESC
I am trying to pull information from SQL that shows me the following:
Case Number "CASE_ID"
Case Note "CASE_DECR"
Case Note Added Date "DATEADDED_DTTM"
My report keeps coming out with duplicate case numbers because there are multiple case notes in each case. I want the report to show me only the "Newest" case note. (Only one Case number per case note)
I think I have the SQL Statement down but it doesn't work in Crystal. Am I on the right track? Thank you for the help!
SELECT TOP 1 DATEADDED_DTTM,CASE_ID FROM TABLE_NAME
WHERE CASE_ID IN (SELECT DISTINCT CASE_ID FROM TABLE_NAME)
ORDER BY ADDED_DTTM DESC