Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 06:38 AM
Afternoon everyone! I logged in hoping to see some suggestions but think maybe I need to reword the question a little 🙂
How can I create a UDF that converts '30000101' to timestamp and then use it in a query like below?
%sql
select
field1,
field2,
nvl(somedatefield, myUDF)
In other words, if the somedatefield in the source is null, always return 30000101 formatted as Timestamp
thanks!!
Labels:
- Labels:
-
SQL
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2022 08:43 AM
Got it working (but going to post a new question momentarily): I needed to use timestamp(date '3000-01-01) instead of to_timestamp