I would like to know how to filter only rows where the value of column 'a' in a data table is an even number.
땡규
이미 성공을 했어.
아래의 쿼리로 실행이 되었어
WHERE [NUM] MOD 2 = 0
MOD is a MySQL function. In this case you do actually need to use the % operator. But PAD reserves % as the character for variable notation. So, you need to escape it. The correct way to escape % is to use %%. So, try this:
SELECT [NUM]
FROM [%str_sheetName_Num%$]
WHERE [NUM] %% 2 = 0
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.
SELECT [NUM]
FROM [%str_sheetName_Num%$]
WHERE [NUM] MOD 2 = 0
;
Can you please share the entire SQL statement, if you are still having a problem?
WHERE [NUM] MOD 2 = 0
thank you
I'm trying to find an even value with a sql statement, but it says it's a grammar error.
where [num] % 2 = 0
Could you please check?
The easiest way to do it would be reading the data from Excel via a SQL query. You can then set the filters in the query. See here for more reference on how to do it: https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/sql-queries-excel
Otherwise, you would need to process your table via C#/Python or similar scripts, or create a new table, loop through the Excel data and insert even numbers into the new table. Either way it is less efficient than running a SQL query to Excel.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.
thank you...
but, i wanna ...
I would like to know how to use it in desktop flows.
Hi @chobo_power0901 ,
Do you want to get the even values in a column in Excel? Please try this:
If you want to filter the records with even numbers in a column, please try this:
Best regards,
Rimmon Li
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,004
Most Valuable Professional