Dates acting like numbers

Pete64

Registered User.
Local time
Today, 22:35
Joined
Jul 1, 2003
Messages
37
I am trying to grab dates in a certain range inputted by the user on a form and grab from and to date criteria but I try and the dates are acting like numbers, I have tryed to enclose form reference like #[forms].[frmVAT].[txtFrom]# but syntax error. DOnt know what to do. please help

I want something like
---------------------------
>=[forms].[frmVAT].[txtFrom]

<=[forms].[frmVAT].[txtTo]

OR a between this values

Any examples would help thanks

best regards
---------------
Pete o(o_0)o
----------------:confused:
 
One of these?

Between DateValue([Forms]![frmVAT]![txtFrom]) And DateValue([Forms]![frmVAT]![txtTo])

Between "#" & [Forms]![frmVAT]![txtFrom] & "#" And "#" & [Forms]![frmVAT]![txtTo] & "#"
 
trying

still doesnt work, I try 03/01/02-06/11/03 it grabs no 2002 results even though there should be results for that year.
Could it be something to do with the fact am grabing the values from forms textboxs as I have tried to see if its incorrect date formating yet it aint I tested to see the date in the query and it was correct any idea.
 
I was using a query as the source for the query would that make a difference anyway I've just referenced the table and everything works now yet I dont understand why using a query instead of a table would give me different results. Any more ideas need to know

like the pic mile u lookin good :eek:
 
Maybe in the query there were other criteria preventing the 2002 results from showing ...

Regards
 
Another possiblity is that in your query, you formatted the dates as strings. When you compare two strings that you think are dates, the results will seem strange to you.
 

Users who are viewing this thread

Back
Top Bottom