I'm trying to get the age of the person when they placed the order. The code works, but not on every record, I 've included the results. It for some reason does the calculation when the record is in UTC, but not in a different format. What can I do because I don't have access to changing the data table.
select Orders.created_at,Profiles.date_of_birth AS Profiles__date_of_birth,
TIMESTAMPDIFF(YEAR, Profiles.date_of_birth, CURRENT_DATE()) AS Age
FROM travelers
LEFT JOIN profilesProfiles ON travelers.profile_id = Profiles.id
LEFT JOIN ordersOrders ON travelers.order_id = Orders.id
I can't do that, I'm not an admin, just a user, so no access to uploading anything. I was just wondering if there was something I could do within the sql to work with it.