I've got a bunch of queries which use a few different dates in different WHERE clauses in PROC SQL statements. Some of those queries are pass-through queries to Teradata. I've gone through documentation and other questions/answers here, and tried different things to figure this out, but I haven't found the solution that works. This is what I want to do:
connect to teradata as mycon(server= dwprod3 authdomain=teradataauth mode=teradata );
create table MyTable as
select * from connection to mycon
(
Select *
From COC_V20_NOHAPHI.TABLE
WHERE TABLE.RecordDate between &StartDate. and &EndDate.
);
I have searched google for "terradata date litereal" and found next link,
which I believe you'll find there the syntax:
http://teradataforum.com/l070316a.htm
example taken from there:
Literals
Date literals can be specified in many ways:
-- in the same format as the column they are being compared to
where infamy_date = '12/07/1941'
-- with an explicit format
where infamy_date = '07Dec1941' (date, format 'DDMMMYYYY')
-- in ANSI standard form (must be preceded by the keyword DATE)
where infamy_date = date '1941-12-07'
-- in numeric form (not recommended)
where infamy_date = 411207
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.