{"id":2326,"date":"2020-05-17T21:55:42","date_gmt":"2020-05-17T21:55:42","guid":{"rendered":"https:\/\/portfolio.accrualhub.com\/powergi2\/?p=205"},"modified":"2025-03-05T20:51:17","modified_gmt":"2025-03-05T20:51:17","slug":"dynamic-sql-queries-with-excels-power-query","status":"publish","type":"post","link":"https:\/\/powergi.net\/de\/blog\/dynamic-sql-queries-with-excels-power-query\/","title":{"rendered":"Dynamic SQL queries with Excel\u2019s Power Query"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"2326\" class=\"elementor elementor-2326\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3ee8da8e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3ee8da8e\" data-element_type=\"section\" data-e-type=\"section\" data-settings='{\"jet_parallax_layout_list\":[]}'>\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-138d4e5\" data-id=\"138d4e5\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-58087222 elementor-widget elementor-widget-text-editor\" data-id=\"58087222\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\n<h2 class=\"wp-block-heading\">Use an excel table to modify your SQL query<\/h2>\n\n<p class=\"wp-block-paragraph\">If you regularly run queries to any database in your workplace, chances are you have encountered a user request like this:<\/p>\n\n<figure class=\"wp-block-image size-large is-resized\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-206\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-1024x890-1.webp\" alt=\"\" width=\"524\" height=\"455\">\n<figcaption><br>You need to select from the DB based on a long list of specific records.<\/figcaption>\n<\/figure>\n\n<p class=\"wp-block-paragraph\">We can use Excel to query the database and get the information requested, but you will have to manually write the <em>WHERE<\/em> conditions that include the Sales Order number and the year. But what if you receive these requests 2-3 times a week from several different users? Wouldn\u2019t it be nice if you (or your end user) could just copy and paste the list of desired values into a table, and after refreshing the file see in the spreadsheet the new results within seconds?<br>This is where <a href=\"https:\/\/powergi.net\/microsoft-power-platform-consulting-services\/\"><strong>Power Platform consulting<\/strong><\/a> can greatly enhance efficiency by automating parts of the workflow and ensuring seamless data retrieval.<\/p>\n\n<p class=\"wp-block-paragraph\">We\u2019ll achieve this by <strong>writing a dynamic SQL statement that will build the <em>WHERE<\/em> conditions based on the list of values<\/strong> that we will have in the Requested Sales Orders table.<\/p>\n\n<h3 class=\"wp-block-heading\"><strong>Build dynamic WHERE conditions<\/strong><\/h3>\n\n<ol class=\"wp-block-list\">\n<li><strong>Connect to your database Using the \u201cGet and Transform Data\u201d options. Just go to Data -&gt; Get Data -&gt; Database \u2013 &gt; MySQL (or SQL, Oracle, IBM depending on your database)<\/strong><\/li>\n<\/ol>\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" class=\"wp-image-208\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-1-972x1024-1.webp\" alt=\"\" width=\"484\" height=\"510\"><\/figure>\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li><strong>In the pop up, fill out with Server, Database and open the advanced options so you can paste\/write your SQL code. <\/strong><\/li>\n<\/ol>\n\n<p class=\"wp-block-paragraph\">Write the SQL with all the columns that you will need in final the result and optionally, write \u201climit 10\u201d at the end to avoid loading too many records (if SQL Server, you will have to use the TOP 10 statement). Click OK and then load your results to a spreadsheet<\/p><div id=\"seology-cta-1\">\t\t<div data-elementor-type=\"section\" data-elementor-id=\"7267\" class=\"elementor elementor-7267\" data-elementor-post-type=\"elementor_library\">\n\t\t\t<div class=\"elementor-element elementor-element-7e3f164 e-con-full e-flex e-con e-parent\" data-id=\"7e3f164\" data-element_type=\"container\" data-e-type=\"container\" data-settings='{\"background_background\":\"classic\",\"jet_parallax_layout_list\":[]}'>\n\t\t<div class=\"elementor-element elementor-element-9078c9f e-con-full e-flex e-con e-child\" data-id=\"9078c9f\" data-element_type=\"container\" data-e-type=\"container\" data-settings='{\"jet_parallax_layout_list\":[]}'>\n\t\t\t\t<div class=\"elementor-element elementor-element-7b99949 elementor-widget elementor-widget-heading\" data-id=\"7b99949\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<p class=\"elementor-heading-title elementor-size-default\">Turn your ideas into digital solutions<\/p>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8e61db5 elementor-widget elementor-widget-heading\" data-id=\"8e61db5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<p class=\"elementor-heading-title elementor-size-default\">Our team guides you step by step to build custom apps in Power Platform.<\/p>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-a578907 e-flex e-con-boxed e-con e-child\" data-id=\"a578907\" data-element_type=\"container\" data-e-type=\"container\" data-settings='{\"jet_parallax_layout_list\":[]}'>\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e8c827b elementor-view-stacked elementor-shape-circle elementor-widget elementor-widget-icon\" data-id=\"e8c827b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<a class=\"elementor-icon\" href=\"#ctc_chat\">\n\t\t\t<i aria-hidden=\"true\" class=\"fab fa-whatsapp\"><\/i>\t\t\t<\/a>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d834237 elementor-view-stacked elementor-shape-circle elementor-widget elementor-widget-icon\" data-id=\"d834237\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<a class=\"elementor-icon\" href=\"https:\/\/powergi.net\/de\/contact\/\">\n\t\t\t<i aria-hidden=\"true\" class=\"far fa-envelope\"><\/i>\t\t\t<\/a>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<\/div>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-209\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-2-1024x811-1.webp\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">This selected the columns we wanted in the report, now we need to let Excel know which specific rows we want.<\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-211\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2020\/05\/image-4.png\" alt=\"\"><\/figure>\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li><strong>Copy the list of values with the year and paste into a new spreadsheet. Format it as a table, we are going to name it as \u201cSales_Orders\u201d<\/strong><\/li>\n<\/ol>\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" class=\"wp-image-213\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-6-365x1024-1.webp\" alt=\"\" width=\"295\" height=\"829\"><\/figure>\n\n<p class=\"wp-block-paragraph\">This will take you to the Query Editor. Let\u2019s change the Year column data type to Text<\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-212\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2020\/05\/image-5-1024x271.png\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">Now, before moving on to the next step, let\u2019s review quickly how your SQL would look if you were to write the conditions by hand for two sales orders:<\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-214\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-7-1024x452-1.webp\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">Basically, we need to be able to generate <code><em>(salesordernumber = '[<strong>SALES ORDER NUMBER<\/strong>]' and year(orderdate) = [<strong>SALES ORDER YEAR<\/strong>])<\/em> <\/code>by each row we have in the Sales Order table.<\/p>\n\n<ol class=\"wp-block-list\" start=\"5\">\n<li><strong>Add a new Custom column<\/strong><\/li>\n<\/ol>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-215\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-8-1024x328-1.webp\" alt=\"\"><\/figure>\n\n<ol class=\"wp-block-list\" start=\"6\">\n<li><strong>In the formula box, write the condition(s) that should be in the final SQL statement. In this case, we need Sales Order and Year of the Order date to match what we have in each of the columns of our list of values<\/strong><\/li>\n<\/ol>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-216\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/powergi-image-14887.webp\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">This should be the result when you add the columns (make sure you concatenate correctly by using the <strong>quotation marks<\/strong> (<strong>\u201c<\/strong>) and the <strong>&amp;<\/strong> sign):<\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-217\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2020\/05\/image-10-1024x159.png\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">Note that Sales Order Number is a string value so is wrapped in single quotation marks (just like it would be wrapped in a regular SQL statement). Year is integer so we don\u2019t have quotation marks around.<\/p>\n\n<p class=\"wp-block-paragraph\">Now hit OK and this should be the result:<\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-218\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-11-1024x656-1.webp\" alt=\"\"><\/figure>\n\n<ol class=\"wp-block-list\" start=\"7\">\n<li><strong>Convert the new column to a list:<\/strong><\/li>\n<\/ol>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-219\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-12-1024x819-1-1.webp\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">This will be the result:<\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-220\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-13-1024x787-1.webp\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">We are almost there and now we need to put all those rows together. The final set of conditions should look like this: <em><code>([SALES ORDER #] = 'XYZ' AND YEAR = 2000) <strong>OR <\/strong>([SALES ORDER #] = 'ABC' AND YEAR = 2001) <strong>OR<\/strong> ([SALES ORDER #] = 'OPQ' AND YEAR = 2003<\/code>)<\/em>\u2026<\/p>\n\n<p class=\"wp-block-paragraph\">To achieve this, we\u2019re going to use the \u201cText.Combine\u201d function.<\/p>\n\n<ol class=\"wp-block-list\" start=\"8\">\n<li><strong>Go to the Formula bar and write <em><code>Text.Combine(<\/code> <\/em>right before the \u201c#\u201d sign, and at the very end write a comma and then<em> <code>,\" OR \")<\/code><\/em><\/strong><\/li>\n<\/ol>\n\n<p class=\"has-text-color wp-block-paragraph\" style=\"color: #ff0004;\"><strong>Before:<\/strong><\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-223\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2020\/05\/image-16-1024x109.png\" alt=\"\"><\/figure>\n\n<p class=\"has-text-color wp-block-paragraph\" style=\"color: #ff0004;\"><strong>After:<\/strong><\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-222\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2020\/05\/image-15-1024x114.png\" alt=\"\"><\/figure>\n\n<ol class=\"wp-block-list\" start=\"9\">\n<li><strong>We just need to add \u201cWHERE\u201d at the beginning of the text. Write <code>\" WHERE \"&amp;<\/code><\/strong> in the formula bar<\/li>\n<\/ol>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-224\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2020\/05\/image-17-1024x115.png\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">After that, we will have all the conditions together in one single text, with the WHERE keyword:<\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-226\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-18-1024x493-1-1.webp\" alt=\"\"><\/figure>\n\n<ol class=\"wp-block-list\" start=\"10\">\n<li><strong>Let\u2019s go back to the main query and edit the SQL statement, and click on the \u201cSource step\u201d<\/strong><\/li>\n<\/ol>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-227\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-19-1024x282-1.webp\" alt=\"\"><\/figure>\n\n<ol class=\"wp-block-list\">\n<li>Remove the \u201climit 10\u201d part and Let\u2019s concatenate the existing query with the name of the query that has all the conditions we just defined<\/li>\n<\/ol>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-228\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-20-1024x320-1.webp\" alt=\"\"><\/figure>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-229\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-21-1024x317-1.webp\" alt=\"\"><\/figure>\n\n<ol class=\"wp-block-list\" start=\"12\">\n<li><strong>Depending on your power query set up, you can get the following error, this is fixed in the Query Options screen<\/strong><\/li>\n<\/ol>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-230\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2020\/05\/image-22-1024x185.png\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">Go to file -&gt; Options and Settings -&gt; Query Options<\/p><div id=\"seology-cta-2\">\t\t<div data-elementor-type=\"section\" data-elementor-id=\"7283\" class=\"elementor elementor-7283\" data-elementor-post-type=\"elementor_library\">\n\t\t\t<div class=\"elementor-element elementor-element-7e3f164 e-con-full e-flex e-con e-parent\" data-id=\"7e3f164\" data-element_type=\"container\" data-e-type=\"container\" data-settings='{\"background_background\":\"classic\",\"jet_parallax_layout_list\":[]}'>\n\t\t<div class=\"elementor-element elementor-element-9078c9f e-con-full e-flex e-con e-child\" data-id=\"9078c9f\" data-element_type=\"container\" data-e-type=\"container\" data-settings='{\"jet_parallax_layout_list\":[]}'>\n\t\t\t\t<div class=\"elementor-element elementor-element-7b99949 elementor-widget elementor-widget-heading\" data-id=\"7b99949\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<p class=\"elementor-heading-title elementor-size-default\">Is your business ready for automation?<\/p>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8e61db5 elementor-widget elementor-widget-heading\" data-id=\"8e61db5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<p class=\"elementor-heading-title elementor-size-default\">Automate processes with Microsoft Power Platform.<\/p>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-a578907 e-flex e-con-boxed e-con e-child\" data-id=\"a578907\" data-element_type=\"container\" data-e-type=\"container\" data-settings='{\"jet_parallax_layout_list\":[]}'>\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e8c827b elementor-view-stacked elementor-shape-circle elementor-widget elementor-widget-icon\" data-id=\"e8c827b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<a class=\"elementor-icon\" href=\"#ctc_chat\">\n\t\t\t<i aria-hidden=\"true\" class=\"fab fa-whatsapp\"><\/i>\t\t\t<\/a>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d834237 elementor-view-stacked elementor-shape-circle elementor-widget elementor-widget-icon\" data-id=\"d834237\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<a class=\"elementor-icon\" href=\"https:\/\/powergi.net\/de\/contact\/\">\n\t\t\t<i aria-hidden=\"true\" class=\"far fa-envelope\"><\/i>\t\t\t<\/a>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<\/div>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-231\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-23-1024x539-1.webp\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">Go to Privacy section and make sure the second option is selected<\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-232\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-24-1024x649-1.webp\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">After that, error will go away:<\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-233\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-25-1024x272-1.webp\" alt=\"\"><\/figure>\n\n<ol class=\"wp-block-list\" start=\"13\">\n<li><strong>Close and load your changes and you will see the table in the spreadsheet with the new results:<\/strong><\/li>\n<\/ol>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-234\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/powergi-image-14839-1.webp\" alt=\"\"><\/figure>\n\n<h3 class=\"wp-block-heading\"><strong>All set! <\/strong>Next time you get a similar request:<\/h3>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-235\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2020\/05\/image-27-1024x377.png\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">Just copy and paste the values into the \u201cSales_Orders\u201d table and hit \u201crefresh all\u201d:<\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-236\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/powergi-image-14886.webp\" alt=\"\"><\/figure>\n\n<p class=\"wp-block-paragraph\">And see new results showing up in <strong>SECONDS<\/strong>! If a user has SELECT permissions to the database this is a good alternative for them to modify the statement without having to deal with writing code.<\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-238\" src=\"https:\/\/powergi.net\/wp-content\/uploads\/2026\/07\/image-29-1024x700-1-1.webp\" alt=\"\"><\/figure>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Use an excel table to modify your SQL query If you regularly run queries to any database in your workplace, chances are you have encountered a user request like this: We can use Excel to query the database and get the information requested, but you will have to manually write the WHERE conditions that include [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2620,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"glossary_letter":"","footnotes":""},"categories":[25],"tags":[13,26,24,16],"class_list":["post-2326","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-power-query-cat","tag-automation","tag-data","tag-data-transformation","tag-excel"],"glossary_letter":null,"rank_math_title":null,"rank_math_description":"Learn to create dynamic SQL queries from Excel using Power Query. Power up your data extraction with this technical guide from Power GI.","rank_math_focus_keyword":null,"_links":{"self":[{"href":"https:\/\/powergi.net\/de\/wp-json\/wp\/v2\/posts\/2326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/powergi.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/powergi.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/powergi.net\/de\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/powergi.net\/de\/wp-json\/wp\/v2\/comments?post=2326"}],"version-history":[{"count":0,"href":"https:\/\/powergi.net\/de\/wp-json\/wp\/v2\/posts\/2326\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/powergi.net\/de\/wp-json\/wp\/v2\/media\/2620"}],"wp:attachment":[{"href":"https:\/\/powergi.net\/de\/wp-json\/wp\/v2\/media?parent=2326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/powergi.net\/de\/wp-json\/wp\/v2\/categories?post=2326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/powergi.net\/de\/wp-json\/wp\/v2\/tags?post=2326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}