Home › Forums › Backend Issues (wp-admin) › SQL command to update the age field based on date of birth › Reply To: SQL command to update the age field based on date of birth
This must be done in php and cannot be done with an SQL query. ACF stores dates in “Ymd” format and not as a valid SQL date value. “Y-m-d H:i:s”.
If you are doing this with a cron you will need to get all of the users, loop over them, get the fields and calculate in PHP and then update the field.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.