Query, between, Null, IF, And .........UGH

K

Kevbro7189

I have a query that is looking at 3 dates, Ticket date, Issue Date, and
Return date. I want to know if the Ticket Date falls between the Issue and
Return dates. My problem is with entries with Null Return Dates. I want the
query to look at Null Return dates as Now or grater. This is the expression
I have come up with so far but it doesn’t work.

Between [Date issued] And (If(IsNull([Date Returned])),Now())
 
A

Allen Browne

Try this:

Between [Date issued] And IIf([Date Returned] Is Null, Now(), [Date
Returned])
 
K

Kevbro7189

Thank you works GRATE!!!!!!!!!!

Allen Browne said:
Try this:

Between [Date issued] And IIf([Date Returned] Is Null, Now(), [Date
Returned])

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Kevbro7189 said:
I have a query that is looking at 3 dates, Ticket date, Issue Date, and
Return date. I want to know if the Ticket Date falls between the Issue and
Return dates. My problem is with entries with Null Return Dates. I want
the
query to look at Null Return dates as Now or grater. This is the
expression
I have come up with so far but it doesn’t work.

Between [Date issued] And (If(IsNull([Date Returned])),Now())
 
S

scubadiver

Grate ???

or

Great :)

Kevbro7189 said:
Thank you works GRATE!!!!!!!!!!

Allen Browne said:
Try this:

Between [Date issued] And IIf([Date Returned] Is Null, Now(), [Date
Returned])

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Kevbro7189 said:
I have a query that is looking at 3 dates, Ticket date, Issue Date, and
Return date. I want to know if the Ticket Date falls between the Issue and
Return dates. My problem is with entries with Null Return Dates. I want
the
query to look at Null Return dates as Now or grater. This is the
expression
I have come up with so far but it doesn’t work.

Between [Date issued] And (If(IsNull([Date Returned])),Now())
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top