Re: Type mismatch in a criteria that used to work



I have seen that behavior in the past. Query seems to run fine UNTIL you apply criterion, but when you do, it blows up.

Since applying the criteria against the calculated value means that every record is touched and one record with an error seems to be all you need to "blow" the query out of the water.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


Bob Barrows [MVP] wrote:
John Spencer wrote:
SELECT [downtime 1].Date
, [downtime 1].DESCRIPTION
, Left([description],6) AS linetype
, [downtime 1].[reason code]
, [downtime 1].comments
, [downtime 1].duration
, [downtime 1].dtstart
, [downtime 1].dtfinish
, [downtime 1].dtevent
, [downtime 1].[start time]
, [downtime 1].[finish time]
, [downtime 1].shift
FROM [downtime 1]
WHERE [downtime 1].shift=[Forms]![Downtime Report]![Combo58] OR
[Forms]![Downtime Report]![Combo58] is Null

I suspect that the error is occuring in the DownTime 1 query.


That was my first thought, except he said the query runs fine without
the criterion.

.



Relevant Pages

  • Re: More Specific Access Performance Questions
    ... > all query criteria fields and join fields indexed: ... say you have a join of two tables and a criterion on ... > Is it OK to have a simple criteria of fulfillment status = false ... I used to do saved queries for these things, ...
    (comp.databases.ms-access)
  • Re: Qerying a Flat / related Tables....between dates....
    ... A brief quote from an John Vinson (Access MVP) posting. ... as the criterion in your Query. ... It's convenient to base a second Form or Report on the resulting query to ...
    (microsoft.public.access.queries)
  • Re: "DateWorked:" Asked as parameter but not desired
    ... Then remove the criterion that asks for a year to be entered. ... >> <MS ACCESS MVP> ... >>> Here is the SQL code that I have to collect total overtime hours for a ... the query asks me for a date worked. ...
    (microsoft.public.access.queries)
  • Re: Date or Time range
    ... Then use this criterion expression for this calculated field: ... >> You need to tell us information about how you're storing date and time ... >> <MS ACCESS MVP> ... >>> to a query that shows all of the activity for the day. ...
    (microsoft.public.access.queries)
  • Re: section in criteria
    ... A brief quote from a John Vinson (Access MVP) posting. ... as the criterion in your Query. ... It's convenient to base a second Form or Report on the resulting query to ... select which staff name for example. ...
    (microsoft.public.access.queries)