Query dates less than today?

thudson

Old Programmer
Local time
Today, 21:07
Joined
Apr 29, 2011
Messages
68
I am trying to write a query to list any items whoes dates are less than today.
The following expression evaluates whether the expression is true or not and gives either 0 or -1 as the result.
Code:
Expr1: ([Date relisted]+30)<Now()
If I put either false or even -1 in the criteria it does not evaluate the expression, but gives all the items.
I don't know if I'm being really thick today, but I can't see what I am doing wrong.
Please help!
 
I am trying to write a query to list any items whoes dates are less than today.
...
Expr1: ([Date relisted]+30)<Now()

No where did you mention 30 days from today, so I am unclear why you have used that in your expression. Also, the logic doesn't need to go into what is displayed, you just need the field itself and then use the criteria area to filter it. In design view this is how you accomplish your stated goal:

1. Bring down [Date relisted] into your query.
2. Underneath it, in the criteria section put <Date()


That's it, that will filter your query as you stated you wanted.
 
Hi
Got it to work using this expression:
Code:
Between [Forms]![Home]![Date_Test1] And [Forms]![Home]![Date_Test2]
What I did not explain before is that I wanted to check if any of my listings on eBay had been relisted and had not missed any.
The criteria above was on a calculated field which added 30 days to the date I entered when it was relisted.
Code:
Listed Until: [Date relisted]+30
Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom