I need help to convert SQL management query to Teradata

Database

I need help to convert SQL management query to Teradata

Here is SQL management Query

select Create_User_ID, Create_Dt, Count(8) as TFollowups,

Sum(CASE WHEN Followup_Dt < DateAdd(DAY, DateDiff(DAY, 0, GetDate()), 0) AND CMPLT_IND=0 THEN 1 ELSE 0 END) As PDueFollowups

From ACSS_Followup_V

where Create_User_ID ='aaabbmm'

and create_dt between '2015-12-01' and '2015-12-31'

group by create_acss_user_id, create_Dt

order by create_Dt

Could someone please help me to datafunctions to Teradata?

2 REPLIES
Junior Contributor

Re: I need help to convert SQL management query to Teradata

DateAdd(DAY, DateDiff(DAY, 0, GetDate()), 0) returns the start of the current day as a DateTime, this is equivalent to CAST(CURRENT_DATE AS TIMESTAMP(0))

Re: I need help to convert SQL management query to Teradata

Thank you, this helps!