
Originally Posted by
Bazzlad
Just a quick query, any SQL gurus may be able to help here.
When I run this:
SELECT * FROM tblproblem
WHERE [reported by] ='karl'
or [reported by] ='Rich'
And [Date reported] Between forms!frmreportbuilder!text12.value And forms!frmreportbuilder!text14.value
And [Repaired] = yes
AND [external help enlisted] between yes and no
And [repair date] Between forms!frmreportbuilder!text25.value And forms!frmreportbuilder!text27.value
AND [In use] between yes and no ;
Why do the conditions only apply to records from "Rich" and not "Karl"?
What am I missing?
you need
Code:
SELECT * FROM tblproblem
WHERE ([reported by] ='karl'
or [reported by] ='Rich')
And [Date reported] Between forms!frmreportbuilder!text12.value And forms!frmreportbuilder!text14.value
And [Repaired] = yes
AND [external help enlisted] between yes and no
And [repair date] Between forms!frmreportbuilder!text25.value And forms!frmreportbuilder!text27.value
AND [In use] between yes and no ;
at the moment it is running
Code:
SELECT * FROM tblproblem
WHERE [reported by] ='karl'
or ([reported by] ='Rich'
And [Date reported] Between forms!frmreportbuilder!text12.value And forms!frmreportbuilder!text14.value
And [Repaired] = yes
AND [external help enlisted] between yes and no
And [repair date] Between forms!frmreportbuilder!text25.value And forms!frmreportbuilder!text27.value
AND [In use] between yes and no) ;