I have a problem with dates in queries.

From: P Van Veen (ppvanveen_at_sympatico.ca)
Date: 06/30/04


Date: Tue, 29 Jun 2004 21:04:57 -0400

SELECT Schedule.ScheduleDate, Customers.ContactLastName,
Customers.BillingAddress, Customers.City, Customers.PhoneNumber,
Workorders.Make, Workorders.Model, Workorders.ProblemDescription,
nz(DateValue([ScheduleDate])) AS DateCheck, Weekday([ScheduleDate],2) AS
WeekDay, Schedule.WorkorderID, Schedule.EmployeeID, Schedule.Notes,
Customers.Ext, nz(DLookUp("ScheduleDate","Date Check"),Date()-1) AS
LastSched
FROM Customers INNER JOIN (Schedule LEFT JOIN Workorders ON
Schedule.WorkorderID = Workorders.WorkorderID) ON Customers.CustomerID =
Schedule.CustomerNum
WHERE (((nz(DateValue([ScheduleDate])))=DateValue(Date())) AND
((nz(DLookUp("ScheduleDate","Date Check"),Date()-1))<Date()))
ORDER BY Schedule.ScheduleDate;

When I run this query I get a Data Type Mismatch Error. If I remove this
portion of query it runs
OK --------------------------------------------WHERE
(((nz(DateValue([ScheduleDate])))=DateValue(Date()))

Thing is it was running just fine for last 3 years on multiple machines. I
have exported database objects to a fresh database and same problem. I have
also tried running on another machine where and it still fails???

Any help would certainly be greatly appreciated!

Pete Van Veen



Relevant Pages

  • Re: I have a problem with dates in queries. Fixed!!!
    ... > FROM Customers INNER JOIN (Schedule LEFT JOIN Workorders ON ... > When I run this query I get a Data Type Mismatch Error. ... > Thing is it was running just fine for last 3 years on multiple machines. ... > have exported database objects to a fresh database and same problem. ...
    (microsoft.public.access.queries)
  • Re: T-SQL BUG?
    ... This bug is also present in SQL-Server 7.0. ... orders.CustomerID in this query, ... equal to customers.CustomerID (due to the INNER JOIN ON clause). ... > FROM customers INNER JOIN orders ...
    (microsoft.public.sqlserver.programming)
  • Re: Problem writing query to get latest date and action from table
    ... FROM Customers INNER JOIN tblOrderFormsSent ... Use the saved query in the next query ... syntax error. ... FROM Customers INNER JOIN tblOrderFormsSent ON Customers.[Customer ...
    (microsoft.public.access.queries)
  • Re: T-SQL BUG?
    ... This intermediate resultset consists of the columns in the select ... column alias to for example customerid1, the query works. ... > FROM customers INNER JOIN orders ... > This is wrong, as the column specification is clearly different, one ...
    (microsoft.public.sqlserver.programming)
  • Re: Problem writing query to get latest date and action from table
    ... trierd to use your query. ... I've attached what I used from your query. ... FROM Customers INNER JOIN tblOrderFormsSent ON Customers.[Customer ...
    (microsoft.public.access.queries)