Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2025 10:19 PM
I want to create a widget in SQL and use it in R later. Below is my code
%sql
declare or replace date1 date = "2025-01-31";
declare or replace date2 date ;
set var date2=add_months(date1,5);
What's the correct syntax of using date2 to create a widget? I have tried
CREATE WIDGET TEXT date_end DEFAULT date2;
CREATE WIDGET TEXT date_end DEFAULT $date2;
CREATE WIDGET TEXT date_end DEFAULT :date2;
and none worked.
If there are other ways to let R access a variable in SQL, I'd love to learn that too.
Thank you,
Labels:
- Labels:
-
Azure databricks
-
Azure Databricks SQL