Desktop productivity for business analysts and programmers

How to change dttm to dt format

Reply
Occasional Contributor
Posts: 13

How to change dttm to dt format

Hi,

I am running the following codes. Just wondering how do I change the dttm to come out as a proper date format?

 

PROC SQL;

CREATE TABLE WORK.QUERY_FOR_AUDIT_VISUALANALY_0000 AS

SELECT t1.timestamp_dttm,

 

t1.userid,

t1.object_type,

t1.executor_nm,

t1.newlasr_server_name,

t1.newlocation,

t1.newtable_name

FROM TMP00002.audit_visualanalytics t1

WHERE t1.timestamp_dttm > 31/12/2018;

QUIT;

 

 

regards

Cathy

Esteemed Advisor
Posts: 5,475

Re: How to change dttm to dt format

Use

 

datepart(t1.timestamp_dttm) as timestamp_dt,

 

and

 

WHERE calculated timestamp_dt > '31DEC2018'd

PG
Ask a Question
Discussion stats
  • 1 reply
  • 100 views
  • 0 likes
  • 2 in conversation