Incorrect SQL conversion into String::Format statement.

  • Thread starter Thread starter Przemek
  • Start date Start date
P

Przemek

Hi
A problem is - how can I make that statement correct? - I would like to
SELECT somenthink like that:

String *SQLstatement = String::Format(S" SELECT * FROM Table WHERE Date =
{0}", DateTimePicker1->Value->ToShortDateString() );

There is a String statement (*SQLstatement) so I concatenate DateTimePicker1
value as string value too. But I've got an "incorrect data type error". Is
there any
solution to make this cnvertion clear - maybe using any SQL finction inside
string?.

[Access file - "Date" column type: DateTime, oleDbDataAdapter]
Good day, thanks for wrote.
 
Przemek said:
A problem is - how can I make that statement correct? - I would like to
SELECT somenthink like that:

String *SQLstatement = String::Format(S" SELECT * FROM Table WHERE Date =
{0}", DateTimePicker1->Value->ToShortDateString() );

I would suggest not doing that in the first place. Use parameters
instead, and you don't need to do any conversion yourself.
 
solution to make this cnvertion clear - maybe using any SQL finction
inside
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top