Skip to content
Advertisement

sql distinct statement not working in powershel script

I am trying to run the following sql command on a powershell script: I set the following as a variable:

after some other commands, i have the following:

The above command works perfectly in SQL, but when I run on my powershell I get the error:

Please can anyone advise?

Thank you.

Advertisement

Answer

Thank you to Luuk and Astentx for your replies.

I have now working ok, the issue was the " and spaces on example 1

I replaced the spaces with _ and removed the " and t works absolutely fine.

Here is the result:

Thank you all.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement