Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here
Sep 24, 2020 02:09 PM
Hi! I’m working on a database that tracks kittens placed in foster for a shelter. I know how to use DATETIME_DIFF to get weeks, but am hoping to get weeks and days. Ideally, I would like to have it read XwYd. Can anybody help?
Sep 24, 2020 03:57 PM
To get the remaining number of days, you need to use DATETIME_DIFF
to get the time in days, then use MOD
to find the remainder after dividing by 7.
MOD(
DATETIME_DIFF({end date}, {start date}, 'days'),
7
)