Re: Not working correctly
Don't you need to format the date string appropriately for your database?
e.g. {d '2005-02-02'}
Re: Not working correctly
Thats what i thought originally.
Then i found a web site that said-
date = date is same as
date = format(date, "dd-mm-yyyy")
I tried it in a textbox and it was right.
Unless i'm getting american dates and british dates mixed up somewhere.
Re: Not working correctly
So, if you do a Debug.Print on strsql what do you get?
On my PC Date() returns "02/02/2005 ". For SQL Server this should be {d '2005-02-02'}
VB Code:
"{d '" & Format(Date,"yyyy-mm-dd") & "'}"
Re: Not working correctly
access data base store dates mm/dd/yy pattern, so you may need to format your date to that pattern to make it match
rgds pete
Re: Not working correctly
have you also seen the replies in the other almost identical thread of yours
p.
Re: Not working correctly
Lol, i have tried everything that has already been mentioned apart from the sql part. Thats why i posted it. It seems really wierd. I assumed its something wrong in the sql statement.
Re: Not working correctly
See i even tried puting the date in directly-
[Date] = '02/02/2005'
exactly as it appears in access. It's printing blank invoices. Can't work this one out. seems really wierd.
Re: Not working correctly
Quote:
access data base store dates mm/dd/yy pattern, so you may need to format your date to that pattern to make it match
I don't have MSAccess on this PC, but I have no reason to disbelieve Pete. Do you need to use "02/02/05" instead of "02/02/2005"?
Re: Not working correctly
I worked it out.
It's cause i cant use ' ' i have to use # #. they are date delimiters
Re: Not working correctly
as replies in the other thread indicated you need to enclose a date in # date #
characters
Re: Not working correctly
Did it? I must of forgot that. I didn't know that sql sees ' ' as text, numbers have nothing and dates have # #.
So i just put in [Date] = #" & multipledate & "#
Re: Not working correctly
if you look at the list of threads in this forum you will see that aprox the 7th one down is also by you with the same title as this thread and i and hack answered you some time ago
rgds pete
Re: Not working correctly
well my bad. Didn't remember it so didn't look at it.