# Replacing a hard coded date with a job variable in a SQL component

**URL:** <https://matillioncommunity.discourse.group/t/replacing-a-hard-coded-date-with-a-job-variable-in-a-sql-component/2234>\
**Category:** Matillion ETL\
**Created:** [June 28, 2023, 3:25pm UTC](https://matillioncommunity.discourse.group/t/replacing-a-hard-coded-date-with-a-job-variable-in-a-sql-component/2234 "2023-06-28T15:25:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hilary.koerner](https://avatars.discourse-cdn.com/v4/letter/h/dc4da7/32.png) [@hilary.koerner](https://matillioncommunity.discourse.group/u/hilary.koerner)\
**Post date:** [June 28, 2023, 3:25pm UTC](https://matillioncommunity.discourse.group/t/replacing-a-hard-coded-date-with-a-job-variable-in-a-sql-component/2234/1 "2023-06-28T15:25:04Z")

</div>

I am using a SQL Component to generate a view. I am pivoting in the SQL component and currently have my pivot values as dates that are hard coded. I want to replace those dates with variables ${last\_day\_q1\_current\_year}.

&nbsp;

I have tried swapping out 2023-03-31 for ${last\_day\_q1\_current\_year} which throws a mismatched data type error and I have tried adding single quotes '${last\_day\_q1\_current\_year}' which validates but creates a field '2023-03-31' with no values.

&nbsp;

I have tried putting date in front of '${last\_day\_q1\_current\_year}' but am not having any luck.

---

<div class="post-metadata">

**Author:** ![marcusblackhill](https://sea2.discourse-cdn.com/flex002/user_avatar/matillioncommunity.discourse.group/marcusblackhill/32/1262_2.png) [@marcusblackhill](https://matillioncommunity.discourse.group/u/marcusblackhill)\
**Post date:** [June 29, 2023, 4:53pm UTC](https://matillioncommunity.discourse.group/t/replacing-a-hard-coded-date-with-a-job-variable-in-a-sql-component/2234/2 "2023-06-29T16:53:11Z")

</div>

Hi, [@hilary.koerner](https://matillioncommunity.discourse.group/u/hilary.koerner)​ !

Have you tried using double quotes instead? Like "${last\_day\_q1\_current\_year}" ?
