GBritton kindly helped me with the Sql shown below and in isolation works fine.
I need to get the result of the script into a column of my main query.
SELECT t2.* , CASE WHEN t2.TypeID = 4 AND t2.CreateDate < ALL ( SELECT t2.CreateDate FROM tbTable2 t2 WHERE t2.Table1ID = t1.AutoID AND t2.TypeID = 1 AND t2.CreateDate IS NOT NULL ) THEN 'Y' END AS Exceeded FROM tbTable1 t1 JOIN tbTable2 t2 ON t1.AutoID = t2.Table1ID
I am unable to get the result into a column of my main query.
My main query is returning the rows that I need and I have a column called "ArcId" returned by the main query. I would like to use the value in this column to get the "Exceeded" value from the Sql script above.
Would anyone know how I could do that.
Thanks for the help.