Reserved Error -3201 when running a query

C

chickenfriedsteak

I thought I had posted this question before, but I don't see it on the
forum.

I'm managing a db with (amongst many others) two tables; one for
tracking when we do a repair / change control on one of our servers,
the other to track catastrophic failures / unplanned downtime.

I wrote a query that I wanted to pull the following data:

Date of server repair / change control
What type of repair / change was implemented
Date of failure
What type of failure was experienced
Name of server

Criteria:
Server Name (Change Control) = Server Name (Failure) AND
Date of Repair/Change is exactly on or up to 31 days prior to Date of
Failure

(Basically, find a way to correlate a failure to a change control on
the same server, if performed within 31 days).

Below is my query statement, but I get the error "Reserved error
(-3201); there is no message for this error." Can anyone point me in
the right direction here?


SELECT tblServerRepairs.CurDate, tblServerRepairs.ServerName AS
tblServerRepairs_ServerName, tblServerRepairs.ChangeImplemented,
tblDowntimeFailures.FailureDate, tblDowntimeFailures.ServerName AS
tblDowntimeFailures_ServerName, tblDowntimeFailures.TypeofFailure,
tblDowntimeFailures.Details, tblServerRepairs.[Hardware-Software]
FROM tblServerRepairs, tblDowntimeFailures
WHERE (((tblDowntimeFailures.FailureDate) Between Date
([tblServerRepairs].[CurDate]) And Date([tblServerRepairs].[CurDate]
+31)) AND ((tblDowntimeFailures.ServerName)=[tblServerRepairs].
[ServerName]));
 
J

John Spencer MVP

I think you mean to use CDate and not Date in the where clause. I would also
do a join between the two tables base on ServerName

IS CurDate ever NULL? If so, that is going to generate an error when CDate
attempts to convert it to a date. Why do you need to convert CurDate to a
DateTime value? Is it a text field?

SELECT tblServerRepairs.CurDate
, tblServerRepairs.ServerName AS tblServerRepairs_ServerName
, tblServerRepairs.ChangeImplemented
, tblDowntimeFailures.FailureDate
, tblDowntimeFailures.ServerName AS tblDowntimeFailures_ServerName
, tblDowntimeFailures.TypeofFailure
, tblDowntimeFailures.Details
, tblServerRepairs.[Hardware-Software]
FROM tblServerRepairs INNER JOIN tblDowntimeFailures
ON [tblServerRepairs].[ServerName]=tblDowntimeFailures.ServerName
WHERE tblDowntimeFailures.FailureDate
Between CDate([tblServerRepairs].[CurDate]) And
CDate([tblServerRepairs].[CurDate]+31)


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top