alex
alex

Reputation: 51

Converting timestamp to MM/DD/YY in sql

Currently I have tables that I am trying to join together by dates.

One of them returns a timestamp (2020-12-21 00:13:56.312) and the other 12/21/20. I am trying to make it so I can join these two by date. I am doing this in snowflake and it does not seem that I can use the format() function. Thanks

Upvotes: 1

Views: 159

Answers (2)

leftjoin
leftjoin

Reputation: 38290

In Snowflake:

TO_CHAR(timestamp, 'MM/DD/YY')

Upvotes: 1

GMB
GMB

Reputation: 222402

You could use to_timestamp():

where mytimestamp = to_timestamp(mystring, 'mm/dd/yy')

Upvotes: 0

Related Questions