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 / Hello Need help with s...
Power Automate
Unanswered

Hello Need help with selecting time in sql query

(0) ShareShare
ReportReport
Posted on by 67

am trying to send a daily email for  VALUES Exceeded tolerance

but for some reason i cant use variables inside sql query in power automate 

this how am creating the variable 

Abdulazizhalawa_1-1693837666763.png

this how am using it 

Abdulazizhalawa_2-1693837766207.png

 

 

a sql command that works fine 

SELECT * FROM clParameterValues
WHERE Reasons <> 'did not exceeded tolerance'
AND submit_date >= '2023-09-04 15:00:00.000'
AND submit_date <= '2023-09-04 23:00:00.000';

 

I need to know the the time because am sending email  per shift  

Categories:
I have the same question (0)
  • SamLed Profile Picture
    2,338 Moderator on at

    Hi,

     

    Your expressions should look like this:

     

    • StartDate: formatDateTime(utcNow(), 'yyyy-MM-dd 15:00:00.000')
    • EndDate: formatDateTime(utcNow(), 'yyyy-MM-dd 23:00:00.000')

     

    If you can't use variables, have you considered using compose instead?

    ______________________________________________________________

    If I have answered your question, please Accept the post as solution.
    If you like my response, please Thumbs Up.

     

     

  • Abdulazizhalawa Profile Picture
    67 on at

     yes I have and both dont work further information submit_date column is datetime type and start and end time variables are String 

  • Chriddle Profile Picture
    8,632 Super User 2026 Season 1 on at

    You are doing the string concatination wrong. "&" does not work.

    You can check the concat function or just use an according format string.

    (Since the date functions accept a format string, you don't have to use formatDateTime):

     

    utcNow('yyyy-MM-dd 23:00:00.000')

     

     returns
    '2023-09-05 23:00:00.000'

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard