0

what's wrong with this statement?
adobau.RecordSource = "SELECT * FROM tblbau WHERE year(Bau_datum) => " & Jahr_beg & "AND year(Bau_datum)<= " & (Jahr_beg + intyears)

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by plusplus
0

" & Jahr_beg & "AND
no space must be
" & Jahr_beg & " AND
how to debug:
make a variable with the string ex:
sqlstr= "SELECT * FROM " & foo
place a breakpoint after that
goto watch window
print the sqlstr (by ?sqlstr)
now you have the full string
(if foo="MYTABLE" then
you have
SELECT * FROM MYTABLE
now copy that and
run the that sql command from the IDE of database
(example: if database is MSACCESS open the mdb
create new query
goto sql mode
paste the sql command
and run it.
MSACCESS will comply with more explanations)

0

I did >= instead of => and now it works, thanks for your help, I might still try the "between" it's probably more correct

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.