data type mismatch in query criteria

G

Guest

I get this message when I run this query, but I run the same query with dates
between Jan and Feb and it is fine


SELECT dbo_Inspection.Inspection_Id AS [Inspection ID],
dbo_Inspection.PIH_Project AS [PIC Development Number],
dbo_Validated_Inspections.Validate_Date AS [Date of Upload],
dbo_Checklist.GTM_Modified_Date AS [Date of GTM Action],
CountBusinessDays([Validate_Date],[GTM_Modified_Date]) AS [Business Days
Between Upload and GTM Action]
FROM (dbo_Inspection INNER JOIN dbo_Validated_Inspections ON
dbo_Inspection.Inspection_Id = dbo_Validated_Inspections.Inspection_Id) INNER
JOIN dbo_Checklist ON dbo_Inspection.Inspection_Id =
dbo_Checklist.Inspection_Id
GROUP BY dbo_Inspection.Inspection_Id, dbo_Inspection.PIH_Project,
dbo_Validated_Inspections.Validate_Date, dbo_Checklist.GTM_Modified_Date,
CountBusinessDays([Validate_Date],[GTM_Modified_Date]),
dbo_Checklist.Question_No
HAVING (((dbo_Validated_Inspections.Validate_Date) Between #3/1/2006# And
#4/1/2006#) AND ((dbo_Checklist.Question_No)="FINAL"))
ORDER BY dbo_Validated_Inspections.Validate_Date,
dbo_Inspection.Inspection_Id;


Please help
 
T

Tom Ellison

Dear Akilah:

Temporarily, remove parts of the query until the error goes away. Start
perhaps with the WHERE and HAVING clauses, and the ORDER BY clause.

When you write a query of any size, just write it a bit at a time and run a
quick test. This not only helps isolate any errors you might make, but it
also isolates performance problems and other logical errors.

Tom Ellison
 

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