This thread is resolved. Here is a description of the problem and solution.
Problem:
Why to use UNSIGNED option with date filters
Solution:
oolset Types stores custom date or date and time field value as a UNIX timestamp. which are positive integers. Therefore, when inserting a query filter to test a date custom field you should use the UNSIGNED option. Please note that the NUMBER option will work for “before” (lower than) and “after” (higher than) comparisons, but not for the “equal to” ones.
I am trying to:
I have created two custom fields for the post : event_date and report (checkbox). I want to create 2 views. One to display all futurs post (event_date >= today) and a second one for old events with report (event_date < today AND report checkbox checked).
My first view doesn't work -> No item found. If i remove the filter i obtain all the result with the correct sort order.
the code of the view is quite simple :
I have made some screenshots of the view configuration (filter and so) and the result (with and without filter). Normaly it must display the last two posts. (i have 4 without the filter what is OK but no one with the filter what is wrong).
The view is displayed on my site on the bottom right box of the front page (i'm using layout).
If i use unsigned in place of date or date_time it works. But i don't understand why there's a date and date_time types in the filter if we must use unsigned ?
My site use WPML and use two languages (french and german).
How can i make to display the posts in french when there is no translation for the post (the event_date and report will remain the same between translations) ?
Hello. Thank you for contacting the Toolset support.
Well - Actually, Toolset Types stores custom date or date and time field value as a UNIX timestamp. which are positive integers. Therefore, when inserting a query filter to test a date custom field you should use the UNSIGNED option. Please note that the NUMBER option will work for “before” (lower than) and “after” (higher than) comparisons, but not for the “equal to” ones.
As per our support policy, we entertain only one question per ticket. This will help other users searching on the forum and help us to write proper resolve ticket summery. So I request you to kindly open a new ticket with your each new question.