Error compiling 6.01

magi6162

Well-Known Member
Licensed User
this line:

cmd.CommandText = "SELECT Tipo,Data,Motivo FROM Calendario WHERE Data >= '" & aai & "-" & RiempiStringa(mmi,2) & "-" RiempiStringa(ggi,2) & "' AND Data <= '" & aaf & "-" & RiempiStringa(mmf,2) & "-" & RiempiStringa(ggf,2) & "' ORDER BY Tipo,Data"

compiling 6.01 syntax error

compiling 5.80 all OK

why?:sign0085:
 

agraham

Expert
Licensed User
You are missing an ampersand (in bold) which is the usual source of this problem. Also you may be missing a single quote at the very end of the string.
cmd.CommandText = "SELECT Tipo,Data,Motivo FROM Calendario WHERE Data >= '" & aai & "-" & RiempiStringa(mmi,2) & "-" & RiempiStringa(ggi,2) & "' AND Data <= '" & aaf & "-" & RiempiStringa(mmf,2) & "-" & RiempiStringa(ggf,2) & "' ORDER BY Tipo,Data"
 
Top