Silvio said:
Gary I am not sure where to type/test your conde once I press alt+F11.
at bottom of page is typically the Immediate Window
if its not showing, hit CTRL+G
it was mostly to check that Date()/DateValue
were working on your machine as expected
outside the query.
if so, then I would suspect it must have something to
do with your data.
Have you compacted/repaired backend lately?
Would you mind starting a new database and import
just this table?
Then double-check that this new table's
Dassigned field is type Date/Time.
Then try your query on it?
or this query...
SELECT
Docs.Facilitator,
Docs.[No],
Docs.StreetName,
Docs.DAssigned
FROM Docs
WHERE
(Docs.Facilitator Is Not Null)
AND
(DAssigned >=Date())
AND
(DAssigned < Date() +1);
Anyway, this is the full SQL code for that query: SELECT
Docs.Facilitator,
Docs.[No], Docs.StreetName, Docs.DAssigned, DateValue([DAssigned]) AS
DateOnly
FROM Docs
WHERE (((Docs.Facilitator) Is Not Null) AND
((DateValue([DAssigned]))=Date()));
The query is taking the date from a linked table (Docs) from annother
Access
2003 Database on the server and the front-end is an Access 2003 as
well.
The
[Dassigned] is a date/time field. Some time when I run the query ti
shown
the
records, then I get that message and then all the records show
question
marks instead of data.
:
Gary, I am getting the same error message: "Data type mismatch in
criteria
expression."
:-(
:
this should work
Field: DateOnly: DateValue([Dassigned])
Table:
Sort:
Show: <checked>
Criteria: Date()
Or:
you tried to use "Date" as an alias
for your column
Hello, I am using an expression to extract the date from a field
which has
date and time in it [DAssigned]. To extract only the date I am
using
the
following expression:
Date: DateValue([DAssigned])
Then to limit the number of record to the one from today's date, I
have
entered the following expression as criteria:
=CDate(Date())
However, when i try to run the query I am getting the following
error
message: "Data type mismatch in criteria expression."
What I am doing wrong here?