Link to home
Start Free TrialLog in
Avatar of paintb4707
paintb4707

asked on

This expression is typed incorrectly, or it is too complex to be evaluated.

Hi,

I'm having trouble with a query that used to work but recently decided to stop working even though it hasn't been modified.  I'm receiving the error "This expression is typed incorrectly, or it is too complex to be evaluated." and I determined that it's coming from my DateValue criteria.  I'm confused as to why this is happening though.

SELECT qryFinalizedStartDate.QuoteNumber, qryFinalizedStartDate.QuoteDesc, qryFinalizedStartDate.CustomerName, qryFinalizedStartDate.DraftedBy, qryFinalizedStartDate.PricingReviewedBy, qryFinalizedStartDate.QuoteReviewedBy, qryFinalizedStartDate.DateReceived, qryFinalizedStartDate.DateQuoteSent, [DateQuoteSent]-[DateReceived]+1 AS TurnaroundTime
FROM qryFinalizedStartDate
WHERE (((DateValue([DateQuoteSent]))<=DateValue([Enter an End Date])));

Open in new window


Basically it's just a query used to select a date range between two different date fields.  In the original query I use >=DateValue for my DateReceived field which works fine.  The second query uses <=DateValue for my DateSent field and that's where the issue lies.
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of paintb4707
paintb4707

ASKER

If you mean remove DateValue from the criteria so that it just reads <=[Enter an End Date], I tried that and received the same error
Specifically:


SELECT qryFinalizedStartDate.QuoteNumber, qryFinalizedStartDate.QuoteDesc, qryFinalizedStartDate.CustomerName, qryFinalizedStartDate.DraftedBy, qryFinalizedStartDate.PricingReviewedBy, qryFinalizedStartDate.QuoteReviewedBy, qryFinalizedStartDate.DateReceived, qryFinalizedStartDate.DateQuoteSent, [DateQuoteSent]-[DateReceived]+1 AS TurnaroundTime
FROM qryFinalizedStartDate
WHERE [DateQuoteSent]<=[Enter an End Date]
try this

SELECT qryFinalizedStartDate.QuoteNumber, qryFinalizedStartDate.QuoteDesc, qryFinalizedStartDate.CustomerName, qryFinalizedStartDate.DraftedBy, qryFinalizedStartDate.PricingReviewedBy, qryFinalizedStartDate.QuoteReviewedBy, qryFinalizedStartDate.DateReceived, qryFinalizedStartDate.DateQuoteSent, [DateQuoteSent]-[DateReceived]+1 AS TurnaroundTime
FROM qryFinalizedStartDate
WHERE (((DateValue([DateQuoteSent]))<=cDate([Enter an End Date])));

Open in new window


or this

Parameters [Enter an End Date] DateTime;
SELECT qryFinalizedStartDate.QuoteNumber, qryFinalizedStartDate.QuoteDesc, qryFinalizedStartDate.CustomerName, qryFinalizedStartDate.DraftedBy, qryFinalizedStartDate.PricingReviewedBy, qryFinalizedStartDate.QuoteReviewedBy, qryFinalizedStartDate.DateReceived, qryFinalizedStartDate.DateQuoteSent, [DateQuoteSent]-[DateReceived]+1 AS TurnaroundTime
FROM qryFinalizedStartDate
WHERE (((DateValue([DateQuoteSent]))<=([Enter an End Date])));

Open in new window



Disregard previous comment.  It worked, thank you!