I wanna extract month-year from the date data type from "get rows" in SQL server to compare current month-year.
If month-year in SQL server is equal to current month-year, send the email.
Could anyone help me on this?
Thank you for your time.
Hi @tracytran ,
You can use the formatDateTime expression and convert both of them to the same format and then do the comparison.
formatDateTime(<variable here>, 'MMM-yyyy')
MMM will get the month like Jan/ Feb/ Mar and yyyy will get the year as 2021
So compare the outputs of both the above statements as normal strings.
If the strings match (eg; Oct-2021 for both) then it is time to send the email.
@VJR Thank for your solution.
Here is my flow:
In my table in SQL, I have many rows and OrderDate column, which has date data type. I would like to check whether every single row with OrderDate is equal to the current month-year.
I got the month-year from SQL Server by creating a compose with this expression:
It seems that I only get the order date of the 1st row in SQL table and then apply that value for all other rows.
How could I make it work correctly?
Any help is highly appreciated.
Is there a specific reason you have used "first"? What happens when you remove the "first" function?
I haven't got SQL server on my machine so that I could tell you the exact syntax. Could you please check out some "solved" posts on this forum. I'm sure there are many on SQL server.
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.