SQL Where and Between

CIIIHAN

Access Padawan
Local time
Today, 20:28
Joined
Sep 16, 2011
Messages
34
Hi there!

I'm trying to make an SQL statment which contain both the where and between

like this:
Code:
DoCmd.RunSQL "UPDATE MuhurDB SET location = " & Me.Location & " WHERE Grup =" & Chr(39) & grup & Chr(39) & " AND WHERE muhur BETWEEN " & fromTxt & " AND " & tillTxt
I get the error message about missing operators Error: 3075

What am I doing wrong?
Thanks in advanced!
 
Remove the second WHERE, marked in red.

DoCmd.RunSQL "UPDATE MuhurDB SET location = " & Me.Location & " WHERE Grup =" & Chr(39) & grup & Chr(39) & " AND WHERE muhur BETWEEN " & fromTxt & " AND " & tillTxt

JR
 
Hi there!

I'm trying to make an SQL statment which contain both the where and between

like this:
Code:
DoCmd.RunSQL "UPDATE MuhurDB SET location = " & Me.Location & " WHERE Grup =" & Chr(39) & grup & Chr(39) & " AND [COLOR=red]WHERE[/COLOR] muhur BETWEEN " & fromTxt & " AND " & tillTxt
I get the error message about missing operators Error: 3075

What am I doing wrong?
Thanks in advanced!

you only need one WHERE clue
 
Thanks for the replies!
Deleting the second where did the trick!
 

Users who are viewing this thread

Back
Top Bottom