Hi @Tyler ,
https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/casefunction
or
https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/iiffunction
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have an SQL statement like this:
if @stopDate is null
begin
set @stopDate=dateadd(day,-1,convert(date,getdate()))
set @startDate=dateadd(day,1,dateadd(month,-1,@stopDate))
end
How can I convert this to KQL? I can set one variable fine, but I'm not sure how to do two.
Hi @Tyler ,
Thank you for posting query in Microsoft Q&A Platform.
You can consider writing code as below in this case.
let stopDate = iif(testBool, dateadd(...), <something else>);
let startDate = iif(testBool, dateadd(...), <something else>);
Hope this helps. Please let me know if any further queries.
-------------
Please consider hitting Accept Answer
button. Accepted answers help community as well.
Use let for the variables, as an example below