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

Announcements

News and Announcements icon
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:
  • Michael E. Gernaey Profile Picture
    53,975 Super User 2026 Season 2 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,975 Super User 2026 Season 2 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 288 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard