How can 2 reports work and others fail?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a bunch of reports, and I am trying to change them to all use the same
input forms. I got the form [Report Date Range]![Begin Date Record Time]
working from my first 2 reports, then it faisl in ALL the rest of the
reports. These reports call in line SQl as follows:
/* AllBackups - first report WORKS */
SELECT HistoryRecord.RecordTime, HistoryRecord.TCPIPAddress,
HistoryRecord.Action, HistoryRecord.ActionType, HistoryRecord.ProfileName,
HistoryRecord.TotalTime, HistoryRecord.CompletionCode, HistoryRecord.UserId
FROM HistoryRecord
WHERE (((HistoryRecord.RecordTime)>=[Forms]![Report Date Range]![Begin
Record Date Time] And (HistoryRecord.RecordTime)<=[Forms]![Report Date
Range]![End Record Date Time]) AND ((HistoryRecord.Action)="Backup") AND
((InStr([HistoryRecord]![Action],"Backup"))>"0"))
ORDER BY HistoryRecord.RecordTime;

/* AllFailedFunctions - second report WORKS */
SELECT HistoryRecord.TCPIPAddress, HistoryRecord.Action,
HistoryRecord.ProfileName, HistoryRecord.TotalTime,
HistoryRecord.CompletionCode, HistoryRecord.RecordTime
FROM HistoryRecord
WHERE (((HistoryRecord.CompletionCode)="Failed") AND
((HistoryRecord.RecordTime)>=[Forms]![Report Date Range]![Begin Record Date
Time] And (HistoryRecord.RecordTime)<=[Forms]![Report Date Range]![End Record
Date Time]))
ORDER BY HistoryRecord.RecordTime;


/* AllTapeStatus - third report FAILS*/
SELECT HistoryRecord.RecordTime, HistoryRecord.RecordSource,
HistoryRecord.Action, HistoryRecord.ActionType, HistoryRecord.TapePoolName,
HistoryRecord.TapeVolSer, HistoryRecord.TapeSetName, HistoryRecord.UserId,
HistoryRecord.TCPIPAddress
FROM HistoryRecord
WHERE (((HistoryRecord.RecordTime)>=[Forms]![Report Date Range]![Begin
Record Date Time] And (HistoryRecord.RecordTime)<=[Forms]![Report Date
Range]![End Record Date Time]) AND ((HistoryRecord.Action)="TapeStatus"))
ORDER BY HistoryRecord.RecordTime;

Any ideas? Thanks, Rusty
 
Without looking past something obvious, the following might be an issue
since InStr() returns a numeric value, not a string
(InStr([HistoryRecord]![Action],"Backup"))>"0"
Try change this to
(InStr([HistoryRecord]![Action],"Backup"))>0

There may be other issues.
 
Back
Top