What do these field contain that you are only wanting the Left 8 characters.
Also, the > will be performed on the entire field, not just the Left 8
characters since the inner parenthesis will be evaluated first. If the
fields are dates, then why not set their data type to date/time instead of
text? Also, the Left$ function returns a string, not a date.
For the Between property to work properly, Access is going to need to know
these are dates.
1) If possible, change the data type of the fields to Date/Time. This is
done in the table.
2) Once this is done, you shouldn't need the Left$ function.
3) If the field contains Time as well as the Date and all you want is the
date, try Format instead of Left$. Format also returns a text value.
CDate(Format(IIf([Next Evaluation]>[Next Report Due],[Next Report Due],[Next
Evaluation]), "Short Date"))
4) If you don't use the US date format (mm/dd/yyyy) then you will need to
format your dates in this fashion for the query. Also, I recommend that you
use 4 digit years, not 2 digit.
5) You may need to replace Between with
=[Forms]![frmName]![txtStartdate] And <=[Forms]![frmName]![txtEndDate]
or possibly also add date delimiters
="#" & [Forms]![frmName]![txtStartdate] & "#" And <= "#" &
[Forms]![frmName]![txtEndDate] & "#"
--
Wayne Morgan
Microsoft Access MVP
Katie said:
I checked that and no difference. In my calculating field I pick from two
different columns to get the 'highest' date. My code is:
LatestDate: Left$(IIf([Next Evaluation]>[Next Report Due],[Next Report Due],[Next Evaluation]),8)
Where Next Evaluation and Next Report Due are text fields with 255 in
length (that's the reason why for the Left$ function.
For the criteria I want the "LatestDate" to be: between [StartDate] and
[EndDate]. I even tried just a simple [enter date] for the criteria and get
the same results.