Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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 CONTAINS(TestGroup,'SET UP')
AND NOT CONTAINS(TestGroup,'SET DOWN')
AND NOT CONTAINS(TestGroup,'COLLECTION')
GROUP BY StudyCode
as need to exclude al lthe lines where theTestGroup field contains any of these phrases before calc the MAX
Get an error which is Chinese to me. I read CONTAINS was more efficient than LIKE, but cant work out syntax or will that have same error? I could do it long way round and pull everything in and calcuate the MAX within Power Query.
Appreciate any advice.
Solved! Go to Solution.
@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
Proud to be a Super 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
Proud to be a Super User! |
|
perfect thanks
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |