View Full Version : Where clause with Or


DBL
02-06-2003, 04:38 AM
I've got the following where clause on a print button to filter a report as it opens:

DoCmd.OpenReport "rptAirTransportInvoice", acViewPreview, , "[JODeptDate] " & " between" & F & " and " & T & ""


But I want to add an extra bit so that it includes any records that haven't already been invoiced, regardless of the departure date. I tried

DoCmd.OpenReport "rptAirTransportInvoice", acViewPreview, , "[JODeptDate] " & " between" & F & " and " & T & " Or [jInvoiced] = 0"

but that didn't work.

Any ideas?

Thanks

Mile-O
02-06-2003, 04:43 AM
Try this, not sure if it will work but because you are specifying a date field, you'll have to put # around the dates:

DoCmd.OpenReport "rptAirTransportInvoice", acViewPreview, , "(([JODeptDate] Between #" & F & "# And #" & T & "#) Or ([jInvoiced] = 0))"

DBL
02-06-2003, 04:56 AM
No luck I'm afraid. I've had to create a module to change the British date to the US date so the filter will work so I've dealt with the #F# in the module and should just need the F. I've tried both and neither's working.