Data type mismatch in criteria expression

Yecats131

Registered User.
Local time
Today, 15:14
Joined
Apr 22, 2008
Messages
63
Hello,

I'm trying to write a query that does a few things. They are:

1. Holds two calculated fields. One calculates the 15th day from the effective date and the other calculates the 21st day after the effective date.

2. Displays records that fill in the following criteria:
A. LifeForm = Pending or Health Form = Pending or Dental Form = pending

When I remove the items under #2 the query runs just fine. For some reason I get the error when I had the items from Option A. I've attached a screenshot of the designer as well as the SQL code. Any help I can get would be greatly appreciated! :0)


SELECT Hires.FirstName, Hires.LastName, Hires.EffectiveDate, DateSerial(Year([EffectiveDate]),Month([EffectiveDate]),Day([EffectiveDate])+15) AS [15 Day Reminder], DateSerial(Year([EffectiveDate]),Month([EffectiveDate]),Day([EffectiveDate])+21) AS [21 Day Reminder], HireBenefits.LifeForm, HireBenefits.HealthForm, HireBenefits.DentalForm
FROM Hires INNER JOIN HireBenefits ON Hires.HiresID = HireBenefits.HiresID
WHERE (((HireBenefits.LifeForm)="pending")) OR (((HireBenefits.HealthForm)="pending")) OR (((HireBenefits.DentalForm)="pending"));
 

Attachments

  • Query.jpg
    Query.jpg
    73.2 KB · Views: 190
Actually, I've officalled decided that my problem is not related to item #1 on my list above. I've removed the calculated fields and I am still recieving the error.
 
Okay.. So I figured out my own problem. :) For those who are interested my problem was because the columns were lookup columns. So, I was typing "pending" which is what is displayed, but the actual value is "1".
 

Users who are viewing this thread

Back
Top Bottom