I am quite new to SQL ad I am not sure if this is even possible to create this quid of query on Bigquery. I have 2 columns both in a timestamp
format such as 2023-02-03 08:54:05 UTC
. The first column is called start
and the second end
. I need to find the timediff
between those 2 colons in minutes
but:
count only the difference from
hours
between5:00 A.M
to6:00 P.M
. As an exemple, ifstart
is2023-01-02
at5:58 P.M
andend
is2023-01-03
at5:01 A.M
the result should be 3 minutes.exclude saturday and sunday from calculations
Is this possible using BigQuery? I have not seen any documentation to exclude certain time ranges in their time functions documentation on Google Cloud. I know TIME_DIFF()
but seems there is no way to exclude a range of hours.
Should I create a table with the list of all saturday and sunday as dates during the next couple of years to help me with this query?