Days between two dates | WordPress.org

[ad_1]

I am using for example: GETDATETIMESTRING(fieldname6,dd-mm-yyyy), where fieldname6 is a date time field, and I have no results. I think I need the strings before using DATEDIFF. No matter how, I didnt´t reach any results.

Hello @ohtusabes

If you have two date fields, for example, fieldname1 and fieldname2, the process is as simple as:

ABS(fieldname1-fieldname2)

If you use different controls than the date for fieldname1 and fieldname2, the equation can be implemented as follows:

DATEDIFF(fieldname1, fieldname2, 'dd-mm-yyyy', 'd')['days']

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer