Hi Pree,
I am not ADO query expert but it seems K2 not handling [], I managed to work around using the following:
SELECT Replace (Replace( CONCAT ( '(', 'ui:1', ')'), ')',']'), '(','[') as [2024],
[VehicleNumber] As [100:2],
[City] As [123:10],
[County] As [100:35],
[ZipCode] As [300:30]
FROM VehicleDetails
Hope that helps
Hello Mustafa,
I tried to use the replace and ended up getting StartIndex cannot be less than Zero error. Need to invistigte the code.
Thank you for your response.
Thank you,
Hello Mustafa,
I'm getting ArgumentOutOfRangeException with description as "StartIndex cannot be less than zero.
Parameter name: startIndex".
Thank you,
Pree
Hi Pree,
What version of K2 are you using?
Are you executing the query from the SmartObject Tester tool? if no, can you test it there and let me know if you get the same error please/
Hello Mustafa,
I'm using K2 version 4.7 and yes i'm testing the query using SmartObject Tester Tool.
Thank you,
Pree
Hi Pree,
I am not sure why you're getting the error, here is how it looks in my 4.7 VM:

Please contact K2 Support to investigate the issue further.
Hello Mustafa,
I was trying to use the query against a custom control to export data to excel. I tried to debug the custom control and fould that the ADO query fails on the method SODataAdapter.Fill().
I did a work around for this, not sure if its the best solution.
I executed the ADO query without the square brackets "SELECT 'ui:1' AS [2024], [VehicleNumber] As [100:2], [City] As [123:10], [County] As [100:35], [ZipCode] As [300:30] FROM VehicleDetails" and once a datatable is populated, it gets copied to the excel cells. Here i'm using the replace method to replace 'ui:1' to '[ui:1]'. It works fine now.
Thank you,
Pree