The SQL is below. The data types of the fields are Date/Time, which I am
trying to generate an integer from.
SELECT
Format(((Hour(Time())*60)+Minute(Time()))-(([HourReceived]*60)+[MinutesRecei
ved])+((DateValue(Date())-DateValue([DMDateReceived]))*1440)-(810*(DateDiff(
"y",[DMDatereceived],Date())))-(1260*(DateDiff("ww",[DMDatereceived],Date())
)),"00000")
AS [Time Outstanding], Hour([DMTimeReceived]) AS HourReceived,
Minute([DMTimeReceived]) AS MinutesReceived, qryDMNotDone.ID,
qryDMNotDone.Priority, qryDMNotDone.DeliveryMedium,
qryDMNotDone.AWNumber_EmailSubject, qryDMNotDone.DMDateReceived,
qryDMNotDone.DMTimeReceived, qryDMNotDone.DMDateLogged,
qryDMNotDone.DMTimeLogged, qryDMNotDone.ETCRequest,
qryDMNotDone.RequestTypeAmend, qryDMNotDone.RequestTypeNewProduct,
qryDMNotDone.RequestTypeNewGL, qryDMNotDone.Requestor,
qryDMNotDone.DMReceiver, qryDMNotDone.DMReferredTo,
qryDMNotDone.NumberOfUpdates, qryDMNotDone.BusinessGroup,
qryDMNotDone.Product, qryDMNotDone.AccountType, qryDMNotDone.AWProducts,
qryDMNotDone.TopTierClientName, qryDMNotDone.AmendmentCode,
qryDMNotDone.ProgeonProduct, qryDMNotDone.MFCrossReference,
qryDMNotDone.AccountNumber, qryDMNotDone.IPorMarket,
qryDMNotDone.DMDateFulfilled, qryDMNotDone.DMTimeFulfilled,
qryDMNotDone.DMReferredBack, qryDMNotDone.DMMinutesSpentReferredBack,
qryDMNotDone.DMProblemDescription, qryDMNotDone.DateReferredForBenOwner,
qryDMNotDone.TimeReferredForBenOwner,
qryDMNotDone.DateReceivedBackFromTaxForBenOwner,
qryDMNotDone.TimeReceivedBackFromTaxForBenOwner, qryDMNotDone.DMComments,
qryDMNotDone.NewGCDeactivationNeeded,
qryDMNotDone.NewSOX054009InternalValidation,
qryDMNotDone.NewSOX054009InternalValidator,
qryDMNotDone.NewSOX054009NonDVPAuthorizer, qryDMNotDone.DMRecordLocked,
qryDMNotDone.FunnelManagerName, qryDMNotDone.FunnelManagerID,
qryDMNotDone.DMActionTaken, qryDMNotDone.RequestStatus,
qryDMNotDone.DMFulfillerAction, qryDMNotDone.CCDSTimeCompleted,
qryDMNotDone.DMDateCompleted, qryDMNotDone.DMTimeCompleted,
qryDMNotDone.ProjectCode, qryDMNotDone.QCRequestedBy, qryDMNotDone.QCProblem,
qryDMNotDone.DateQCd
FROM qryDMNotDone
WHERE
(((Format(((Hour(Time())*60)+Minute(Time()))-(([HourReceived]*60)+[MinutesRe
ceived])+((DateValue(Date())-DateValue([DMDateReceived]))*1440)-(810*(DateDi
ff("y",[DMDatereceived],Date())))-(1260*(DateDiff("ww",[DMDatereceived],Date
()))),"00000"))>120)
AND ((qryDMNotDone.DMReceiver) Is Not Null) AND
((qryDMNotDone.DMDateFulfilled) Is Null) AND ((qryDMNotDone.DMTimeFulfilled)
Is Null) AND ((qryDMNotDone.DateReferredForBenOwner) Is Null) AND
((qryDMNotDone.TimeReferredForBenOwner) Is Null));
Douglas J Steele said:
Show us your SQL, and tell us the data type of the field(s) in question.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
I have a query where I calculate time elapsed and am trying to limit the
results to only those outstanding 120 mins. Whenever I add the criteria
to
bring back the results over 120 mins, I either get the Data type mismatch
in
criteria expression message, or the "The expression is typed incorrectly,
or
it is too complex to be evaluated" message. Can someone help me figure
out
what is going on here? I've tried converting to integers, getting the
value,
the whole nine yards. I'm stuck.