cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Forum Posts

vr
by Contributor
  • 5285 Views
  • 3 replies
  • 3 kudos

Resolved! Is timestamp difference always INTERVAL DAY TO SECOND?

My observations show that timestamp difference has type of INTERVAL DAY TO SECONDS:select typeof(getdate() - current_date()) ----------------------------------------- interval day to secondBut is it guaranteed? Can it be DAY TO MINUTE or, say, YEAR T...

  • 5285 Views
  • 3 replies
  • 3 kudos
Latest Reply
sher
Valued Contributor II
  • 3 kudos

you can check here for given example: https://docs.databricks.com/sql/language-manual/functions/minussign.htmlthis might help to you.

  • 3 kudos
2 More Replies
alexa
by New Contributor III
  • 6320 Views
  • 2 replies
  • 0 kudos

Resolved! How to use dateadd in databricks sql ?

I am trying to something like this but getting error like :Error in SQL statement: AnalysisException: Undefined function: 'DATEADD'. This function is neither a registered temporary function nor a permanent function registered in the database 'default...

  • 6320 Views
  • 2 replies
  • 0 kudos
Latest Reply
SergeRielau
Databricks Employee
  • 0 kudos

Dateadd was added in DBR 10.4 and is in DBSQL current.SELECT DATEADD(HOUR,IFNULL(100, 0),current_date) AS Date_Created_Local=> 2022-05-31T04:00:00.000+0000.You can also use one of these casts to turn any wellformed string into an interval:SELECT curr...

  • 0 kudos
1 More Replies
Labels