I have a column 'appointment_date' in string formate representing a date dd.mm.yyyy.
In BiqQuery I am using the following query to find all appointments dates lying in the future:
SELECT appointment_date
FROM `appointments` 
where parse_date('%d.%m.%Y', appointment_date) > current_date()
BiqQuery returns the following error message: Failed to parse input string ""
Please advice.
Thanks, Janine
Use safe.parse() to avoid the error:
where safe.parse_date('%d.%m.%Y', appointment_date) > current_date()
This will return NULL for invalid formats rather than an error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With