In Google Cloud SQL, how can you figure out a date difference?

Associate
Joined
24 Sep 2022
Posts
2
Location
India
I'm attempting to create a query that would show the difference in date between a date recorded in a column and the current date, but I keep receiving the following error:

Code:
"Cannot call method "getTime" of null."

What function can I use to calculate this date difference in Google Cloud SQL?

Current code:

Code:
SELECT date, DATEDIFF(date, CURRENT_DATE()) AS daysLeft
FROM table;
 
Back
Top Bottom