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 4ee51a6

Browse files
committed
docs: amend type examples
1 parent 4db968e commit 4ee51a6

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
@@ -57,7 +57,7 @@ While not officially supported yet, you can work around for other data types via
5757
To convert a parameter to a specific type, use the `::` syntax followed by the type name:
5858

5959
```sql
60-
${lightdash.parameters.parameter_name::type}
60+
${lightdash.parameters.parameter_name}::type
6161
```
6262

6363
<Note>
@@ -70,10 +70,10 @@ As a workaround, you can use `::date` for dates or `::timestamp` for datetime va
7070

7171
```sql
7272
-- Convert to date (workaround)
73-
WHERE ${TABLE}.order_date >= ${lightdash.parameters.start_date::date}
73+
WHERE ${TABLE}.order_date >= ${lightdash.parameters.start_date}::date
7474

7575
-- Convert to timestamp (workaround)
76-
WHERE ${TABLE}.created_at >= ${lightdash.parameters.start_datetime::timestamp}
76+
WHERE ${TABLE}.created_at >= ${lightdash.parameters.start_datetime}::timestamp
7777
```
7878

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

8383
```sql
8484
-- Convert to boolean (workaround)
85-
WHERE ${TABLE}.is_active = ${lightdash.parameters.active_only::boolean}
85+
WHERE ${TABLE}.is_active = ${lightdash.parameters.active_only}::boolean
8686
```
8787

8888
#### Other type conversions
@@ -91,8 +91,8 @@ You can use any SQL type conversion that your database supports:
9191

9292
```sql
9393
-- Convert to specific database types
94-
WHERE ${TABLE}.category_id = ${lightdash.parameters.category::uuid}
95-
WHERE ${TABLE}.amount = ${lightdash.parameters.amount::decimal(10,2)}
94+
WHERE ${TABLE}.category_id = ${lightdash.parameters.category}::uuid
95+
WHERE ${TABLE}.amount = ${lightdash.parameters.amount}::decimal(10,2)
9696
```
9797

9898
## How to reference parameters in SQL

0 commit comments

Comments
(0)

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