Submitted by mca1 on 2011/10/09 12:05
Hi there,
 
I need help with the following configuration:
 
I have a grid that is about to show...
a) all entries that have a checkmark in a specific yes/no - field
PLUS
b) all entries that have a date earlier than today in a specific date - field
 
 
I tried to set up a filter in the sourcebar like this
"PreSelected is not null"
to fulfill my first requirement. That works fine.
 
Now an extension like
"PreSelected is not null OR DTStartPlanned < Today
 
doesn't work. No additional entries are shown.
With
"PreSelected is not null OR DTStartPlanned < # 2011-10-09#
it works, but that would mean that I have to adjust the date entry every day manually.
 
How can I use something like "TODAY" in such a filter query?
 
 
Thanks in advance.
 
By the way: The specific date filter tool won't help me as I can't figure out how to combine this with "OR" with another filter of the grid (e.g. the "PreSelected is not null").

Comments

Try using "now",
For example, I use as a filter for  one of my (daily/journal) grids to get items created in the last 20 days:
ItemCreated> now-20 and ItemCreated <= now
 
It looks like it's in the manual under the filter section, 5.2.4, and there's a blurb that says ("now" returns the current date/time), but like most things, if's easy to find when you know the answer!   I think the Filter Examples should have sections by functions. That was, there would be a "date/time" section, and it may be easier to find.
 

mca1

2011/10/09 12:43

In reply to by KeithB

hi there. Thanks. As far as I can see, "now" does its job.
 
Thank you.

reesd

2011/10/27 17:44

In reply to by mca1

Now() returns the current date and time.
 
Date() returns the current date without the time. So you can use it to work at the date/date level. For example:

today: ItemDate > Date()
in last seven days: ItemDate > Date() - 7
 
If you really want to act in 24 hours you can use Now():
 
last 24 hours: ItemDate > Now() - 1
last 7*24 hours: ItemDate > Now() - 7
 
Note that Datetimes actually use the whole number as the date and the fraction as the time. So you can do things like this:
last twelve hours: ItemDate > Now() - 0.5
today plus last night: ItemDate > Date() - 0.3
 
d
 

I think another way to show today is to use the Date Toolbar
In the date toolbar: ItemCreated =  (then click Today button)

Pierre_Admin

2011/10/11 11:27

In reply to by jan_rifkinson

The date filter toobar would definitely work if... he didn't want to also have items from PreSelected
 
[quote]PreSelected is not null OR DTStartPlanned < # 2011-10-09#[/quote]
 
Have a great day !