Hi Appian community!
I’m a recently certified Associate Developer, and I’ve been working on a scenario that I’d love your thoughts on. It involves translating SQL logic into Appian to make the most of a!queryRecordType.
a!queryRecordType
Here’s the use case:
I have two tables:
IDCase
Status
LogText
CreatedDT
Goal:
LogText = 'Updated'
Status = 'Close'
Here’s the original SQL query I’m trying to translate:
SELECT * FROM ( SELECT IDCase, CONVERT(Date, MAX(CreatedDT)) as 'CreatedDT' FROM ( SELECT A.IDCase, A.CreatedDT, A.LogText, A.IDHISTORY, B.Status FROM [dbo].[HistoryCase] A JOIN [dbo].[CASE] B ON A.IDCase = B.IDCase WHERE A.IDCase IS NOT NULL AND A.LogText LIKE 'Updated%' AND B.Status <> 'Close' ) AS Result GROUP BY IDCase ) AS FinalResult WHERE CreatedDT >= CONVERT(datetime, '2024-11-01') AND CreatedDT <= CONVERT(datetime, '2024-11-30') ORDER BY IDCase;
Discussion posts and replies are publicly visible
Technically speaking if you were to replicate this query verbatim, you have to create a relationship from Case History -> Case. Personally, I prefer to create a 1-n relationship from Case -> Case history. The query would look something like this:
Actually just noticed that seems to be taken from Issue to translate a query from SQL to Appian