0
votes

I am used to living in the T-SQL world; I cannot figure out how to restrict the dates on a couple of simple Teradata queries:

Query 1 ('Report Date' = [TIMESTAMP (6)])

SELECT *
    FROM myTable
    WHERE 'Report Date' >= (CURRENT_DATE - 7)

SELECT Failed 2665: (-2665)Invalid Date


Query 2 ('Created Date' = [DATE])

SELECT *
    FROM myTable2
    WHERE 'Created Date' >= (CURRENT_DATE - 7)

SELECT Failed 2665: (-2665)Invalid Date


I have tried a few different things and cannot get anything to work. I will always want to see seven days back when these tables are queried.

1

1 Answers

0
votes

Doh.. these worked when I wrapped the column aliases in double quotes instead of singles

SELECT *
    FROM myTable
    WHERE "Report Date" >= (CURRENT_DATE - 7)