jconway
Programmer
- Dec 14, 2005
- 50
I'm trying to create today's date as a variable in the format YYYYMMDD. In my expression I'm getting errors with everything I try. I've tried:
cast(convert(varchar(12), getdate(), 112) as int)
select cast(convert(varchar(12), getdate(), 112) as int)
select FullDate
from dim_Date
where DateKey = cast(convert(varchar(12), getdate(), 112) as int)
Can anyone tell me what I'm missing here? It may be quite obvious which is why I'm asking for advice.
Thanks!
cast(convert(varchar(12), getdate(), 112) as int)
select cast(convert(varchar(12), getdate(), 112) as int)
select FullDate
from dim_Date
where DateKey = cast(convert(varchar(12), getdate(), 112) as int)
Can anyone tell me what I'm missing here? It may be quite obvious which is why I'm asking for advice.
Thanks!