Jump to content

C# - ListBox Apresentar dados duvida na Query


Recommended Posts

Boas eu tou com uma duvida nesta query:

SqlCommand cmdVerTodos = new SqlCommand("SELECT Marcacoes.N_Marcacao, Marcacoes.N_Cliente, Marcacoes.N_tratamento, Marcacoes.Data, Marcacoes.Hora, Cliente.Nome FROM Marcacoes INNER JOIN Cliente ON Marcacoes.N_Cliente = Cliente.N_Cliente WHERE Marcacoes.Data >='" + DateTime.Today.ToString("yyyy-MM-dd"), cnSql);

Tenho um botao chamado Ver todas que o objectivo do botao e mostrar todas as marcacoes do dia em que estamos para a frente e dame com essa query o segiunte erro:

Unclosed quotation mark after the character string '2012-06-12'.

Incorrect syntax near '2012-06-12'.

Obrigado agradeco a vossa ajuda 😄

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.