grendell2099
Registered User.
- Local time
- Today, 00:41
- Joined
- Aug 9, 2006
- Messages
- 29
Hi all, I need some help creating a search query that has multiple fields & wildcards. I just can't get it working. I created an unbound form with text boxes for each field that a user can search on. the default value is "*" for each box/ criteria.
After the user fills in their criteria, they click search and a results form opens based on the search query. Unfortunately, I do not return any records- even when "*" is set for all the criteria (except the dates).
Can anyone help me straighten this out?
THIS IS THE SQL VIEW OF MY QUERY (I didn't bother to change the "*" to '*' for this posting):
SELECT InspectionRecords.PartNum, InspectionRecords.PartName, InspectionRecords.Weight, InspectionRecords.Project, InspectionRecords.Priority, InspectionRecords.WBS, InspectionRecords.WD, InspectionRecords.InspectDate, InspectionRecords.NumApproved, InspectionRecords.NumNonConform, InspectionRecords.Disposition, InspectionRecords.Vendor, InspectionRecords.Comments, InspectionRecords.InspectionWaived, InspectionRecords.Engineer, InspectionRecords.PoNum, InspectionRecords.ReceivedDate, InspectionRecords.LotSize, InspectionRecords.Hrs, InspectionRecords.Inspector, InspectionRecords.CertConform, InspectionRecords.CertMaterial, InspectionRecords.CertWeld, InspectionRecords.CertFinish, InspectionRecords.InspectReport, InspectionRecords.INDEX
FROM InspectionRecords
WHERE (((InspectionRecords.PartNum)="6004835") AND ((InspectionRecords.PartName) Like "*") AND ((InspectionRecords.Project) Like "*") AND ((InspectionRecords.Priority) Like "*") AND ((InspectionRecords.WBS) Like "*") AND ((InspectionRecords.WD) Like "*") AND ((InspectionRecords.InspectDate) Between "#01/01/2000#" And "#01/01/2040#") AND ((InspectionRecords.Vendor) Like "*") AND ((InspectionRecords.InspectionWaived) Like "*") AND ((InspectionRecords.Engineer) Like "*") AND ((InspectionRecords.PoNum) Like "*") AND ((InspectionRecords.Inspector) Like "*"))
ORDER BY InspectionRecords.InspectDate;
After the user fills in their criteria, they click search and a results form opens based on the search query. Unfortunately, I do not return any records- even when "*" is set for all the criteria (except the dates).
Can anyone help me straighten this out?
THIS IS THE SQL VIEW OF MY QUERY (I didn't bother to change the "*" to '*' for this posting):
SELECT InspectionRecords.PartNum, InspectionRecords.PartName, InspectionRecords.Weight, InspectionRecords.Project, InspectionRecords.Priority, InspectionRecords.WBS, InspectionRecords.WD, InspectionRecords.InspectDate, InspectionRecords.NumApproved, InspectionRecords.NumNonConform, InspectionRecords.Disposition, InspectionRecords.Vendor, InspectionRecords.Comments, InspectionRecords.InspectionWaived, InspectionRecords.Engineer, InspectionRecords.PoNum, InspectionRecords.ReceivedDate, InspectionRecords.LotSize, InspectionRecords.Hrs, InspectionRecords.Inspector, InspectionRecords.CertConform, InspectionRecords.CertMaterial, InspectionRecords.CertWeld, InspectionRecords.CertFinish, InspectionRecords.InspectReport, InspectionRecords.INDEX
FROM InspectionRecords
WHERE (((InspectionRecords.PartNum)="6004835") AND ((InspectionRecords.PartName) Like "*") AND ((InspectionRecords.Project) Like "*") AND ((InspectionRecords.Priority) Like "*") AND ((InspectionRecords.WBS) Like "*") AND ((InspectionRecords.WD) Like "*") AND ((InspectionRecords.InspectDate) Between "#01/01/2000#" And "#01/01/2040#") AND ((InspectionRecords.Vendor) Like "*") AND ((InspectionRecords.InspectionWaived) Like "*") AND ((InspectionRecords.Engineer) Like "*") AND ((InspectionRecords.PoNum) Like "*") AND ((InspectionRecords.Inspector) Like "*"))
ORDER BY InspectionRecords.InspectDate;