|
-
Nov 29th, 2000, 07:00 PM
#1
Thread Starter
Lively Member
When I run my vb app I get the following error message:
Run Time error ‘3075’
Syntax error (missing operator) in query expression ‘Date1>=#01/01/2999# AND Date2<=#01/31/2000# And City = ‘NY# AND State = ‘New York’
Here is my SQL query:
It takes a snap shot of what is in the db and places it into a temp db the variable is strtempDB
db.Execute "SELECT * INTO Places IN '" & strTempDb & "' FROM Places WHERE Date1>=#" & Format(datFromDate, "mm/dd/yyyy") & "# AND Date2<=#" & Format(datToDate, "mm/dd/yyyy") & "# AND City = '" & (datCity.Text) & "# AND State = '" & (datState.Text) & "'"
Can someone please correct the errr I am encountering:
The problem is either the ' " or the #
Help is appreciated,
Stevie
-
Nov 29th, 2000, 07:10 PM
#2
Hyperactive Member
You're right...
the missing sign is ' after the city= 'NY' you left out the second '
hope it helps...
Code:
db.Execute "SELECT * INTO Places IN '" & strTempDb & "' FROM Places WHERE Date1>=#" & Format(datFromDate, "mm/dd/yyyy") & "# AND Date2<=#" & Format(datToDate, "mm/dd/yyyy") & "# AND City = '" & (datCity.Text) & "' AND State = '" & (datState.Text) & "'"
Saludos...
"Who Dares Wins" - "Quien se Arriesga Gana"
Mail me at: 
-
Nov 29th, 2000, 08:00 PM
#3
Thread Starter
Lively Member
Here is the correction I made:
db.Execute "SELECT * INTO Places IN '" & strTempDb & "' FROM Places WHERE Date1>=#" & Format(datFromDate, "mm/dd/yyyy") & "# AND Date2<=#" & Format(datToDate, "mm/dd/yyyy") & "# AND City = '" & (datCity.Text) & "' AND State = '" & (datState.Text) & "'"
Here is what you wrote as the correction:
the missing sign is ' after the city= 'NY' you left out the second '
db.Execute "SELECT * INTO Places IN '" & strTempDb & "' FROM Places WHERE Date1>=#" & Format(datFromDate, "mm/dd/yyyy") & "# AND Date2<=#" & Format(datToDate, "mm/dd/yyyy") & "# AND City = '" & (datCity.Text) & "' AND State = '" & (datState.Text) & "'"
Gives me the same err
Steve
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
|