Actually the example that you linked is useful in order to convert the date data to a date format (I used date_format(myfiled, '%e %b %Y') as a format;
but what I was asking for is a way to make the date range filter work and it is still not working on my side
1) Can you try to make a a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTable based on a simple query like “SELECT * FROM view1″.
2) If that not help, can you pelase export that table from database so we can test it in our local environment. Please note that this is public ticket so in order to we only see that file,please check PRIVATE checkbox before submitting the replay.
We check your dump file and we can see that this column is not set as datetime type(it is longtext) and do not have proper format for datetime in MySQL. More on this link. This is necessary so datetime filters work properly in our plugin.
Please see the column named 'data_emoglobina', it is formatted as you wrote, that is: '2021-11-19', but the date range filter does not work as expected.
The data in the Date column (in the database) is incorrect. Our guess is that you only moved the structure to "date", and the strings converted into '0000-00-00', which is not a correct date format for MySQL. You can see more info on this link.
The DATE type is used for values with a date part but no time part. MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The supported range is '1000-01-01' to '9999-12-31'.
The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD hh:mm:ss' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.
So, the minimum value date can have in MySQL is 1000-01-01 or NULL. If you replace all 0000-00-00 with "NULL" it will work correctly.
Hi Aleksander, thanks for your reply but I do not understand the point: I have a date format like 2021-12-16, since my field is a date field.....i did not mention time, I am just trying to filter using a date range.
In my database the field is structured as a Date field and in wpdatatables it has been declared as a date field as well, so the filter is a date filter.
Can you please provide me a temporary WP-admin (administrator) user for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue.
We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course, we do not provide login data to third parties.
You can write credentials here just check PRIVATE Reply so nobody can see them except us.
I just mentioned how the structure of DATETIME columns should look like. As mentioned in my previous response, if you take a look at your database table (the one you sent us), you will see cells with '0000-00-00', which is not a valid entry.
It either needs to be 'NULL', or anywhere from '1000-01-01' to '9999-12-31'. Thank you for the remote access, but I can't modify this through your website. You also don't have the "Add new" option under Plugins, so I can't add WP phpMyAdmin plugin to see the database table, and we can only work with the table you sent us before. This is where we noticed the incorrect values, so I'm sure if you check your database table, and modify all entries with '0000-00-00' and change them to 'NULL', that it will work correctly.
If you still have issues after that, please provide me with database access URL and credentials.
I can't access phpMyAdmin like this (see the attachment).
This "16/12/2021" is not the format that's being used in the database. The database format is "2021-12-16", but I can't see your database file anymore (I mistakenly deleted it from my PC).
Can you send it to me again, and can you provide me with direct URL and credentials for the database?
All columns except for "id" and "postid" are saved as "longtext" type:
So, the "data_emoglobina" column (for example) is saved as a string (longtext). It doesn't matter that you changed the type of this column in wpDataTables, it's saved as text and it will never display correct dates until you modify the column type in the database, and add the correct date format (YYYY-MM-DD).
The entry in the database:
Is string, and if you were to change the column type in the database to be "String", it would display the same value. So, in order to keep the "Date" type in wpDataTables, and store dates correctly, you need to change the column type here, and set the date column to be "date", not "longtext". After that you'll be able to store and read the data correctly.
Hello, I am writing to you since I have a table made with the following query:
SELECT codice_fiscale,
data_tipologia_trattamento,
trattamento_ts,
data_emoglobina,
valore_in_gdl_ts,
data_trasferimento_ts,
centro_di_destinazione_ts,
data_comorbidit__,
comorbidita_ts,
data_accesso_dialitico,
accesso_dialitico_ts
FROM sou_nuovi_casi_ts
The field "data_tipologia_trattamento" is e data field, outputting atimestamp:, like "20211118".
Unluckely it is not recognized as date, so I am obbliged to set the column data type as string.
Furthermore if I create a data filter, it does not work at all.
Can you please provide a solution.
Thanks in advance
Hi Emanuele,
Thank you for your purchase.
Sorry for the late response, we have some agents that have contracted Covid-19, so our team is cut in half.
There are a lot of examples on web, especially on stackoverflow for such thing.
One of them is this one where you can find a lot of different solution depends how data is saved in your table in database for this field.
https://stackoverflow.com/questions/9251561/convert-timestamp-to-date-in-mysql-query
Best regards.
Kind Regards,
Isidora Markovic
wpDataTables: FAQ | Facebook | Twitter | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Amelia demo sites | Docs
You can try our wpDataTables add-ons before purchase on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables
Hello
thanks for your response
Actually the example that you linked is useful in order to convert the date data to a date format (I used date_format(myfiled, '%e %b %Y') as a format;
but what I was asking for is a way to make the date range filter work and it is still not working on my side
Hope I better explained which was my issue
kind regards
Hi Emanuele,
1) Can you try to make a a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTable based on a simple query like “SELECT * FROM view1″.
2) If that not help, can you pelase export that table from database so we can test it in our local environment. Please note that this is public ticket so in order to we only see that file,please check PRIVATE checkbox before submitting the replay.
Kind Regards,
Isidora Markovic
wpDataTables: FAQ | Facebook | Twitter | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Amelia demo sites | Docs
You can try our wpDataTables add-ons before purchase on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables
Hello
As you suggested (option 2), I am attaching the sql table on which I am trying to filter by date.
SQL table at this link: https://we.tl/t-1hAvGI4J4x
I am leaving the reply as public since there are no sensitive data.
Thanks
Hi Emanuele,
We check your dump file and we can see that this column is not set as datetime type(it is longtext) and do not have proper format for datetime in MySQL. More on this link. This is necessary so datetime filters work properly in our plugin.
Best regards.
Kind Regards,
Isidora Markovic
wpDataTables: FAQ | Facebook | Twitter | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Amelia demo sites | Docs
You can try our wpDataTables add-ons before purchase on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables
Hi Milan
Please see the column named 'data_emoglobina', it is formatted as you wrote, that is: '2021-11-19', but the date range filter does not work as expected.
You can find the MySql table at this link: https://we.tl/t-VbC4f1bfwf
Thanks
Hey Emanuele
Thanks of the table, it's been forwarded to our developers for review, and as soon as we hear from them, we will let you know.
Sorry for the delay!
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello again Emanuele.
The data in the Date column (in the database) is incorrect. Our guess is that you only moved the structure to "date", and the strings converted into '0000-00-00', which is not a correct date format for MySQL. You can see more info on this link.
The DATE type is used for values with a date part but no time part. MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The supported range is '1000-01-01' to '9999-12-31'.
The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD hh:mm:ss' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.
So, the minimum value date can have in MySQL is 1000-01-01 or NULL. If you replace all 0000-00-00 with "NULL" it will work correctly.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Aleksander, thanks for your reply but I do not understand the point: I have a date format like 2021-12-16, since my field is a date field.....i did not mention time, I am just trying to filter using a date range.
In my database the field is structured as a Date field and in wpdatatables it has been declared as a date field as well, so the filter is a date filter.
Hi Emanuele
Can you please provide me a temporary WP-admin (administrator) user for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue.
We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course, we do not provide login data to third parties.
You can write credentials here just check PRIVATE Reply so nobody can see them except us.
Hi again Emanuele
I just mentioned how the structure of DATETIME columns should look like. As mentioned in my previous response, if you take a look at your database table (the one you sent us), you will see cells with '0000-00-00', which is not a valid entry.
It either needs to be 'NULL', or anywhere from '1000-01-01' to '9999-12-31'. Thank you for the remote access, but I can't modify this through your website. You also don't have the "Add new" option under Plugins, so I can't add WP phpMyAdmin plugin to see the database table, and we can only work with the table you sent us before. This is where we noticed the incorrect values, so I'm sure if you check your database table, and modify all entries with '0000-00-00' and change them to 'NULL', that it will work correctly.
If you still have issues after that, please provide me with database access URL and credentials.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi again Emanuele.
I can't access phpMyAdmin like this (see the attachment).
This "16/12/2021" is not the format that's being used in the database. The database format is "2021-12-16", but I can't see your database file anymore (I mistakenly deleted it from my PC).
Can you send it to me again, and can you provide me with direct URL and credentials for the database?
Remember the Private response
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi again Emanuele
Thank you for the access.
All columns except for "id" and "postid" are saved as "longtext" type:
So, the "data_emoglobina" column (for example) is saved as a string (longtext). It doesn't matter that you changed the type of this column in wpDataTables, it's saved as text and it will never display correct dates until you modify the column type in the database, and add the correct date format (YYYY-MM-DD).
The entry in the database:
Is string, and if you were to change the column type in the database to be "String", it would display the same value. So, in order to keep the "Date" type in wpDataTables, and store dates correctly, you need to change the column type here, and set the date column to be "date", not "longtext". After that you'll be able to store and read the data correctly.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables