H
hanski
Hi
I have the following kind of program in my VBA:
Dim PUTKI As New ADODB.Connection
Dim tarj As New ADODB.Recordset
Dim ap As Date
Dim lp As Date
Set PUTKI = CurrentProject.Connection
ap = InputBox("Give first date")
lp = InputBox("Give last date")
tarj.Open "select * from database where GivenDate =" & ap, PUTKI,
adOpenDynamic, adLockOptimistic
When I start the recordet it gives me error: SYNTAX ERROR. ...
"GivenDate = 1.1.2006"
The value of ap is 1.1.2006 and the value of lp is 15.1.2006
Why does it not accept my date??
Hannu
I have the following kind of program in my VBA:
Dim PUTKI As New ADODB.Connection
Dim tarj As New ADODB.Recordset
Dim ap As Date
Dim lp As Date
Set PUTKI = CurrentProject.Connection
ap = InputBox("Give first date")
lp = InputBox("Give last date")
tarj.Open "select * from database where GivenDate =" & ap, PUTKI,
adOpenDynamic, adLockOptimistic
When I start the recordet it gives me error: SYNTAX ERROR. ...
"GivenDate = 1.1.2006"
The value of ap is 1.1.2006 and the value of lp is 15.1.2006
Why does it not accept my date??
Hannu