# 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/2213>\
**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/2213 "2023-06-28T15:25:04Z")\
**Posts on this page:** 1\
**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/2213/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.
