I use MySQL and PHP, and I want to find the difference between the two dates.
I have a table with a name advertisersthat has a field web_start_date. I want to select all entries where web_start_dateless than 30 days from the current date
advertisers
web_start_date
Just use the datediff function of MySQL.
use the DATEDIFF () function mysql
mysql
WHERE web_start_date < TIMESTAMPADD(DAY, 30, NOW())
hmmm .. try this, see if this works for you :)
SELECT * FROM advertisers WHERE DATE(web_start_date) > DATE_SUB(NOW(), INTERVAL 30 DAY)
Source: https://habr.com/ru/post/1753718/More articles:ΠΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ ΠΎ ΡΠ°ΠΉΠ»ΠΎΠ²ΠΎΠΉ ΡΠΈΡΡΠ΅ΠΌΠ΅ Query Dynamic Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ΠΌ LINQ - c#What should be a json transaction validation check? - app-storeIs ImageIO.write buffered? - javaΠΡΠΎΠ±Π»Π΅ΠΌΠ° Ρ Π·Π°ΠΏΡΠΎΡΠΎΠΌ Π½Π° ΡΠΏΡΡΠΈΠΉ ΡΠ΅ΠΆΠΈΠΌ Ρ ΠΈΠΌΠ΅Π½Π΅ΠΌ - javaHow to configure jndi.properties for DataStore? - javaDatabase Design Considerations - Clarification Required - databaseC # + Resharper - underlined event method - naming convention - c #Drupal Image Image Output in Alt Tag - drupalMaking HTTPS requests in Twisted - pythonFactory pattern implementation using ANSI C - cAll Articles