SQL statement help needed
--------------------------------------------------------------------------------
Hi there,
I have an access 2000 db with a column of data defined as a DOUBLE.
If I construct an SQL query in access like this:
SELECT [table].[item]From mydb WHERE [table].[item] Between 20010101 And 20010105;
It work fine and data is selected.
However if I try it in VB6 (sp5) like this:
strSQL = "SELECT * FROM [mydb] WHERE [table].[item] BETWEEN '" & sdf & "' and '" & xyz & "'"
I get nothing ! sdf and xyz are defined as a doubles (variable names are examples only hence weird names !)
If I try it like this :
strSQL = "SELECT * FROM [mydb] WHERE [table].[item] BETWEEN " & sdf & " and " & xyz & ""
I get data type mismatch.
Any idea on how I should properly construct the query in vb ?
Many thanks
Judda