|
-
Nov 6th, 2001, 05:21 PM
#1
Thread Starter
Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|