Hi,
I have a strange problem. I am running an sql query from vba code within Microsoft Access. I am passing the value of the date from a combo box into the sql string.
My date value (varDate) is 4/5/2008 (4th May 2008)
this is passed into the sql string as ...#" & varDate & "#....
when i debug.print the sql string to the immediate window it appears fine 4/5/2008 (4th May 2008) but it doesnt pull the data back that i expect (there are records present for the 4th May 2008.
The strange part is when I copy my sql string that is printed out in immediate window and put it in a query builder (using sql mode) and then switch the query to design mode the date appears in the criteria box as #5/4/2008# (5th April 2008) which doesnt have any records which is why my data isnt being retrieved via the vba sql string.
Running Access 2003 format from 2007 on XP. Also running Access on 2003 on XP on another PC and acts the same.
Anyone come across this problem before?
Thanks
I have a strange problem. I am running an sql query from vba code within Microsoft Access. I am passing the value of the date from a combo box into the sql string.
My date value (varDate) is 4/5/2008 (4th May 2008)
this is passed into the sql string as ...#" & varDate & "#....
when i debug.print the sql string to the immediate window it appears fine 4/5/2008 (4th May 2008) but it doesnt pull the data back that i expect (there are records present for the 4th May 2008.
The strange part is when I copy my sql string that is printed out in immediate window and put it in a query builder (using sql mode) and then switch the query to design mode the date appears in the criteria box as #5/4/2008# (5th April 2008) which doesnt have any records which is why my data isnt being retrieved via the vba sql string.
Running Access 2003 format from 2007 on XP. Also running Access on 2003 on XP on another PC and acts the same.
Anyone come across this problem before?
Thanks