[AccessD] SQL ANDs

Stephen Bond stephen at bondsoftware.co.nz
Wed Jun 30 20:27:49 CDT 2004


How about ...

WHERE 
(fld1 = Forms!frm!txtBox1 OR IsNull(Forms!frm!txtBox1)) 
AND 
(fld2 = Forms!frm!txtBox2 OR IsNull(Forms!frm!txtBox2)) 
AND   ... etc

Stephen Bond

> -----Original Message-----
> From: Martin Caro [mailto:mcaro at bigpond.net.au]
> Sent: Thursday, 1 July 2004 10:30 a.m.
> To: Access Developers discussion and problem solving
> Subject: [AccessD] SQL ANDs
> 
> 
> Hi Folks
> 
> I have a report query that has a WHERE followered by one or a 
> number of ANDs. The components of the ANDs reference text 
> boxes on a form each of which may or may not be populated. 
> How can I get it to negate one or a number of the ANDs if the 
> target box is Null? At the moment if any one of the AND 
> components is Null no records are returned. I've played 
> around with IIF to test each box first but no luck so far....
> 
> Thanks
> 
> Martin  
> -- 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 



More information about the AccessD mailing list