LuigiCorleone
New member
- Local time
- Today, 00:10
- Joined
- May 14, 2002
- Messages
- 7
I'm importing a date from a form and putting it into SQL as a string variable but its not finding any records.
Here's the important stuff
Dim SQL, str1, str2, strDate As String
str1 = Forms![TestForm].[Start_Date]
str2 = Forms![TestForm].[End_Date]
strDate = "Between #" & str1 & "# And #" & str2 & "#"
SQL = "SELECT asset.Local_ID, /the middle bit of the SQL statement/ '& "WHERE asset_defects.Created_Date " & strDate _
'& " ORDER BY asset.Local_ID"
Its falling over on the variable "strDate".
Any ideas? Formatting/conversion problem?
Thanks
Luigi
Here's the important stuff
Dim SQL, str1, str2, strDate As String
str1 = Forms![TestForm].[Start_Date]
str2 = Forms![TestForm].[End_Date]
strDate = "Between #" & str1 & "# And #" & str2 & "#"
SQL = "SELECT asset.Local_ID, /the middle bit of the SQL statement/ '& "WHERE asset_defects.Created_Date " & strDate _
'& " ORDER BY asset.Local_ID"
Its falling over on the variable "strDate".
Any ideas? Formatting/conversion problem?
Thanks
Luigi