Execute query in UI Path Error

Hello,
I try to use query in UI path. I have a short query:
“Select [Delivery Date], [PoNumber] As ‘OrderNumber’, Case When [New delivDate] Is NULL Then [Delivery Date] Else [New delivDate] End As ‘sapdate’ From [Sheet1$] Where [Purchorder no] = 85XXXXX9 order by ‘NewDate’”

I have to add that my “database” is excel and another queries work correctly.
But when I use this query I’ve got error: Execute Query: Unrecognized keyword WHEN

Somebody has any information about this error?
When I execute this same query in MS SQL I’ve got correct result but in UI Path I’ve got error.
I suppose that it can be UI Path constraint because when I tried run query in UI Path included word CONVERT I receive similar error.

Thank a lot

Hi @Piskulak_Mateusz

Welcome to our UiPath Forum! :slight_smile:

I am not sure, but could it be related?
https://www.excelforum.com/excel-programming-vba-macros/386463-sql-case-statement-on-excel-vba.html

Thanks a lot for prompt :slight_smile:
I think it is answer to my question, because when I using “IIF” my query works.

1 Like