user3534430
user3534430

Reputation: 1

MS Access Expression

I have an Access database I have built from the ground up, I have some queries that I use and work queues. I am trying to narrow down the results of the queries. I have one part that is giving me issues due to how complex the data I am working with is. The one in question I have written the following expression.

Expr1: IIf([Daily Work]![Loan Type]="Renewal"," ",
           IIf([Daily Work]![Boarding Date]=Date(),True,False))   

This is an expression within a query I am looking to see if Loan Type is Renewal and the Boarding Date is the current date, if both those fields are Renewal and Date respectively then mark the record as true, if not then false. It isn't working for me. What can I can do to make this work?

Upvotes: 0

Views: 35

Answers (1)

user3175748
user3175748

Reputation:

I'm guessing you're just not getting the results you expect, versus getting an error.

In that case, I would suggest that [Boarding Date] = Date() is most likely the problem. If [Boarding Date] contains a time component, it won't equal Date(). I usually use a date format to compare dates - i.e.

Format([Boarding Date], "dd mmm yyyy") = Format(Date(), "dd mmm yyyy").

The more explicit you are with dates, the better.

Upvotes: 1

Related Questions