Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f6f42e4

Browse files
committed
docs: amend type examples
1 parent 45bf5a5 commit f6f42e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎guides/using-parameters.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ While not officially supported yet, you can work around for other data types via
6161
To convert a parameter to a specific type, use the `::` syntax followed by the type name:
6262

6363
```sql
64-
${lightdash.parameters.parameter_name::type}
64+
${lightdash.parameters.parameter_name}::type
6565
```
6666

6767
<Note>
@@ -74,10 +74,10 @@ As a workaround, you can use `::date` for dates or `::timestamp` for datetime va
7474

7575
```sql
7676
-- Convert to date (workaround)
77-
WHERE ${TABLE}.order_date >= ${lightdash.parameters.start_date::date}
77+
WHERE ${TABLE}.order_date >= ${lightdash.parameters.start_date}::date
7878

7979
-- Convert to timestamp (workaround)
80-
WHERE ${TABLE}.created_at >= ${lightdash.parameters.start_datetime::timestamp}
80+
WHERE ${TABLE}.created_at >= ${lightdash.parameters.start_datetime}::timestamp
8181
```
8282

8383
#### Boolean conversion
@@ -86,7 +86,7 @@ As a workaround, you can use `::boolean` to convert string values like "true"/"f
8686

8787
```sql
8888
-- Convert to boolean (workaround)
89-
WHERE ${TABLE}.is_active = ${lightdash.parameters.active_only::boolean}
89+
WHERE ${TABLE}.is_active = ${lightdash.parameters.active_only}::boolean
9090
```
9191

9292
#### Other type conversions
@@ -95,8 +95,8 @@ You can use any SQL type conversion that your database supports:
9595

9696
```sql
9797
-- Convert to specific database types
98-
WHERE ${TABLE}.category_id = ${lightdash.parameters.category::uuid}
99-
WHERE ${TABLE}.amount = ${lightdash.parameters.amount::decimal(10,2)}
98+
WHERE ${TABLE}.category_id = ${lightdash.parameters.category}::uuid
99+
WHERE ${TABLE}.amount = ${lightdash.parameters.amount}::decimal(10,2)
100100
```
101101

102102
## How to reference parameters in SQL

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /