[Solved] Pre Filter - Advise on setting up list of upcoming records

Status
Not open for further replies.

esskay

Member
Hello...I have a list of upcoming events and in the pre-filter I have given value as "NOW()- INTERVAL 1 WEEK". This works but also shows records of already over events of the same week. I need value which pre filters list scheduled for the next 7 days...

Also please help me pre-filtering any record of the current date to setup list for ongoing/today's events....

Please advise...
 
Why are you doing "- INTERVAL 1 WEEK" rather than "+ 1 WEEK"?

I would have though two pre-filters would do it ...

WHERE
Field: your_date
CONDITION: greater than or equal
Value: NOW()
Type: no quotes

AND
Field: your_date
CONDITION: less than or equal
Value: NOW() + INTERVAL 1 WEEK
Type no quotes

-- hugh
 
Why are you doing "- INTERVAL 1 WEEK" rather than "+ 1 WEEK"?

It does not work with NOW() + INTERVAL 1 WEEK (Less than or equals) but does work with NOW() - INTERVAL 1 WEEK (Greater than or equals). I do not why ?...I updated links, site address, backend access etc. in My Sites. I have added one more pre filter as suggested by you...

Please have a look...
 
You had both the date tests as "GREATER THAN OR EQUAL".

As per my last post, it needed to be 'greater than or equal to now()' AND 'less then or equal to now() + 1 week'

-- hugh
 
Unfortunately below settings does not work.

1st Option -

AND
Field: your_date
CONDITION: less than or equal
Value: NOW() + INTERVAL 1 WEEK
Type no quotes

When I make Changes as under -

2nd Option -

Code:
AND
Field: your_date
CONDITION:  Greater than or equal
Value: NOW() - INTERVAL 1 WEEK
Type no quotes

This works. In the settings suggested by you (1st Option) pre - filter is not working and no records are shown. When I change settings to 2nd Option the list is filtered correctly.

I will test the other pre filter

WHERE
Field: your_date
CONDITION: greater than or equal
Value: NOW()
Type: no quotes

Ans let you know whether the required results are coming up or not...
 
What do you mean with "is not working"? Do you get an error or don't you get the expected result?
It's working fine on my site.

Can you enable FabrikDebug in Fabrik Options (Debugging tab) and then append &fabrikdebug=1 to your list URL?
A click on "List GetData:" will show you the generated query.
 
I can't see your problem.
I changed your first prefilter to LESS THAN OR EQUALS NOW() + INTERVAL 1 WEEK
and it's showing the expexted 7-1-2017 event in frontend and backend.
 
Yup, that's exactly what I saw. There's one event in the unfiltered list due in the next week, and the filters I set up correctly show that one event.

Sent from my HTC 10 using Tapatalk
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top