T
Thorson
I have several queries that have been working perfectly, however I recently
added a field "EntryDate" and a criteria expression to limit which records
are pulled up. Now the queries will sometimes run and look fine, but if I
try to sort or look through the records the error "Data type mismatch in
criteria expression" comes up, this often comes up when I initially run the
query as well. I'm assuming something is wrong with the Criteria/Where part
of my SQL:
SELECT [qryBirthInfoandPurchas/Don].eartag,
[qryBirthInfoandPurchas/Don].calftattoo, tblBirthInformation.EntryDate,
[qryBirthInfoandPurchas/Don].calfbirthdate, tblBirthInformation.EntryDate,
[qryBirthInfoandPurchas/Don].calfsex, [qryBirthInfoandPurchas/Don].Expr1004,
[qryBirthInfoandPurchas/Don].BirthUnit,
[qryBirthInfoandPurchas/Don].BirthLocation
FROM tblBirthInformation RIGHT JOIN ([qryBirthInfoandPurchas/Don] RIGHT JOIN
[qryCurrentInventoryBirthInfoandPurchas/Don] ON
[qryBirthInfoandPurchas/Don].eartag =
[qryCurrentInventoryBirthInfoandPurchas/Don].eartag) ON
tblBirthInformation.EarTag =
[qryCurrentInventoryBirthInfoandPurchas/Don].eartag
WHERE
(((tblBirthInformation.EntryDate)<=DateSerial(Year([qryBirthInfoandPurchas/Don]![calfbirthdate]),Month([qryBirthInfoandPurchas/Don]![calfbirthdate])+1,5))
AND
(([qryBirthInfoandPurchas/Don].calfbirthdate)<=[Forms]![frmCurrentInventoryDateQuery]![txtDate]))
OR
(((tblBirthInformation.EntryDate)>DateSerial(Year([qryBirthInfoandPurchas/Don]![calfbirthdate]),Month([qryBirthInfoandPurchas/Don]![calfbirthdate])+1,5))
AND
((tblBirthInformation.EntryDate)<=[Forms]![frmCurrentInventoryDateQuery]![txtDate]));
Thanks for any help you can provide!
added a field "EntryDate" and a criteria expression to limit which records
are pulled up. Now the queries will sometimes run and look fine, but if I
try to sort or look through the records the error "Data type mismatch in
criteria expression" comes up, this often comes up when I initially run the
query as well. I'm assuming something is wrong with the Criteria/Where part
of my SQL:
SELECT [qryBirthInfoandPurchas/Don].eartag,
[qryBirthInfoandPurchas/Don].calftattoo, tblBirthInformation.EntryDate,
[qryBirthInfoandPurchas/Don].calfbirthdate, tblBirthInformation.EntryDate,
[qryBirthInfoandPurchas/Don].calfsex, [qryBirthInfoandPurchas/Don].Expr1004,
[qryBirthInfoandPurchas/Don].BirthUnit,
[qryBirthInfoandPurchas/Don].BirthLocation
FROM tblBirthInformation RIGHT JOIN ([qryBirthInfoandPurchas/Don] RIGHT JOIN
[qryCurrentInventoryBirthInfoandPurchas/Don] ON
[qryBirthInfoandPurchas/Don].eartag =
[qryCurrentInventoryBirthInfoandPurchas/Don].eartag) ON
tblBirthInformation.EarTag =
[qryCurrentInventoryBirthInfoandPurchas/Don].eartag
WHERE
(((tblBirthInformation.EntryDate)<=DateSerial(Year([qryBirthInfoandPurchas/Don]![calfbirthdate]),Month([qryBirthInfoandPurchas/Don]![calfbirthdate])+1,5))
AND
(([qryBirthInfoandPurchas/Don].calfbirthdate)<=[Forms]![frmCurrentInventoryDateQuery]![txtDate]))
OR
(((tblBirthInformation.EntryDate)>DateSerial(Year([qryBirthInfoandPurchas/Don]![calfbirthdate]),Month([qryBirthInfoandPurchas/Don]![calfbirthdate])+1,5))
AND
((tblBirthInformation.EntryDate)<=[Forms]![frmCurrentInventoryDateQuery]![txtDate]));
Thanks for any help you can provide!