All Forums Database
Nbaskaran 2 posts Joined 01/16
06 Jan 2016
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?
 

dnoeth 4628 posts Joined 11/04
06 Jan 2016

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))

Dieter

Nbaskaran 2 posts Joined 01/16
06 Jan 2016

Thank you, this helps!

You must sign in to leave a comment.