Dates values not working properly in SQL statement.

G

Guest

Afternoon,
I'm having a big problem with a form which generates various SQL statements
based on combo boxes.
I have found out that SQL uses US date formatting but whats happening now is
totally confusing...

I have 4 combo boxes (TABLENAME/FIELD/OPERATOR/VALUE)
The date value in the combo box appears like so

#05-Oct-07#

However when the SQL statement is created it will come through like this

#05/10/07# (and no results are produced)
Why does it do this? I tried input masks on the combo boxes with no luck..

The code is like this


strSQL = "SELECT " & cboTables.Value & ".* INTO NewTable FROM " &
cboTables.Value & " WHERE " & cboFields.Value & " " & cboOperator.Value & " "
& " #" & cboValues.Value & "#" & " AND " & cboFields2.Value & " " &
cboOperator2.Value & " #" & cboValues2.Value & "#"

Any help is greatly appreciated..

Mike Harkess
 

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

Top