Re: Parameter Query and Date calculations....



Access is not good at determining the data types of calculated query fields,
parameters, and unbound controls. You will need to help it understand the
data type you intend, and it will then return the correct results.

Wrap the calculated date field in CVDate()
Declare any parameter in your query.
If the query refers to an unbound control on a form, set the Format property
of the control to Short Date or similar.

More details in:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

The way Access stored the date/time data is not the problem. If you use
non-US dates, you might like to read this also:
International Date Formats in Access
at:
http://allenbrowne.com/ser-36.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Julie Wardlow" <jlwardlow@xxxxxxxxxxx> wrote in message
news:r65Se.5200$Ys5.637@xxxxxxxxxxxxxxxxxxxxxxx
> Help!
>
> I am calculating a future date using the DateAdd function in a query (the
> calculation also involves an IIf statement), and have managed to get this
> formula to produce the required result.
>
> I then want to search through the records and select those with dates (as
> caluclated above) within a user defined range, and so I am using a
> parameter
> query. However, this query returns dates outside of the range and appears
> to
> have particular problems in differentiating between years (2005 cf 2006).
> But when the dates are not calculated but worked out and entered manually
> the correct records are selected using the same criteria.
>
> Since both my criteria and the equation work correctly independantly I am
> assuming the problem is somehow related to the way Access stores dates.
> Does
> anyone know anything about this or how I could resolve the problem?


.



Relevant Pages

  • Re: conditional formatting in form slows down calculations
    ... table to see all dates and a filtered query to see recent dates. ... endless calculating when the form opens. ... Once it finished the calculating, ... > CF (Conditional Formatting) is a weird beast, and it can cause the strange ...
    (microsoft.public.access.forms)
  • Re: formatting a calculated number field on a form
    ... > I only used age at death as an example. ... > and heart attack, age 40 and heart attack, surgery and death, etc. ... >>bit different in that a parameter query limits the recordset before it ... I assumed that you were calculating on ...
    (microsoft.public.access.forms)
  • Re: query error
    ... "Jeff Boyce" wrote: ... The second query groups them by job number for one total time on job. ... you've already recorded start and stop times, the TaskTime value could be ... I have a specific job number that is not calculating ...
    (microsoft.public.access.queries)
  • Re: query error
    ... The second query groups them by job number for one total time on job. ... you've already recorded start and stop times, the TaskTime value could be ... I have a specific job number that is not calculating properly. ...
    (microsoft.public.access.queries)
  • Re: reserved error -1524 access 2007
    ... OT and cod are the same type ... If OT is a query, ... difficult to trace what's going on without details of the field types. ... It might be that JET is getting the data types mixed up. ...
    (microsoft.public.access.queries)