Forum Discussion
mike_asplin
1 year agoHelper V
Trying to use SQL to calculate a max excluding certain lines
Way beyond my SQL abilties I tried this code SELECT
StudyCode ,
MAX( Date_ScheduledPulldate) as 'Trial End Date'
FROM
Custom_PullPointDate
WHERE
Recordstatus=1
AND NOT CONTA...
- 1 year ago
mike_asplin , Try using
SELECT
StudyCode,
MAX(Date_ScheduledPulldate) AS 'Trial End Date'
FROM
Custom_PullPointDate
WHERE
Recordstatus = 1
AND TestGroup NOT LIKE '%SET UP%'
AND TestGroup NOT LIKE '%SET DOWN%'
AND TestGroup NOT LIKE '%COLLECTION%'
GROUP BY
StudyCode
bhanu_gautam
1 year agoSuper User
mike_asplin , Try using
SELECT
StudyCode,
MAX(Date_ScheduledPulldate) AS 'Trial End Date'
FROM
Custom_PullPointDate
WHERE
Recordstatus = 1
AND TestGroup NOT LIKE '%SET UP%'
AND TestGroup NOT LIKE '%SET DOWN%'
AND TestGroup NOT LIKE '%COLLECTION%'
GROUP BY
StudyCode
mike_asplin
1 year agoHelper V
perfect thanks