Skip Navigation

[Resolved] datetime field not working in query

This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by rexJ-2 6 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1118961
Skærmbillede 2018-10-02 kl. 10.58.45.png

I am trying to: ave a 1 to many relation ship between student and appointment
the appointment table have a datetime field.
Why is that field not working in a view query

Link to a page where the issue can be seen:
hidden link
I expected to see:
sorted with a custom datetime field
Instead, I got: nothing

#1119275
Screen Shot 2018-10-02 at 3.00.32 PM.png

Hi, you should update the Query Filter setting to "between THIS_YEAR and FUTURE_YEAR(1)" if you want to include all dates in the current year. Otherwise, only items on January 1 will be shown. For best results, we recommend "UNSIGNED" instead of "number". See the screenshot here for the appropriate configurations.

I expected to see: sorted with a custom datetime field
The "Ordering" option is set to "Post date". You should change this if you want to sort by the custom date field.

#1119692
Skærmbillede 2018-10-03 kl. 08.28.17.png
Skærmbillede 2018-10-03 kl. 08.15.52.png
Skærmbillede 2018-10-03 kl. 08.16.37.png
Skærmbillede 2018-10-03 kl. 08.18.24.png
Skærmbillede 2018-10-03 kl. 08.18.48.png
Skærmbillede 2018-10-03 kl. 08.21.18.png
Skærmbillede 2018-10-03 kl. 08.21.42.png

Still many problems.....
Nothing shows up.
1: Is it a problem with custom fields in a one to many relation on either the post types in the relation?
2: If not. My dato field (Date) in custom fields is of type Date. You tell that i can make an query on that field with ordering set to custom date field. I have done that stil nothing shows up?! (thought the ordering just was an sorting mechanism and not part of the query?).
3: What is the problem with showing date formatted fields and manipulation of date fields in views from toolset point of view?

#1119748

My issue is resolved now. Thank you!