web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / SQL statement unrecogn...
Power Automate
Unanswered

SQL statement unrecognized keyword WHEN

(1) ShareShare
ReportReport
Posted on by 2

While using SQL execute  with Case Statement, The keyword WHEN is not recognizing. The Below Error is coming

"SQL statement unrecognized keyword WHEN"

 

The SQL query as given below

 

SELECT [Material],[Value Unrestricted]
case 
 when  [Material]>0 then 'h1'
end as Valuation
         
FROM [Sheet1$]

 

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,928 Moderator on at

    @kkreddy 

    Please provide pictures, so we can see and understand what you are doing. Are you trying to use SQL against an Excel Sheet? What are you doing?


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • kkreddy Profile Picture
    2 on at

    Hi Michael Gernaey,

    I am trying to use SQL against an excel in Power automate desktop.

    kkreddy_0-1720894360255.png

     

    kkreddy_1-1720894765012.png

     

  • Michael E. Gernaey Profile Picture
    53,928 Moderator on at

    Hi @kkreddy 

     

    In that result should it be "H1" I cannot remember and wonder if thats it.

     

    I haven't specifically tried to use When through Power Automate Desktop, and wonder what type of connection are you using to open Excel (ODBC?? ADO.NET? JET??)


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 315 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 273 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 117 Super User 2026 Season 1

Last 30 days Overall leaderboard