Conversion of SQL server query to teradata query

UDA
Fan

Conversion of SQL server query to teradata query

Hi,

If anyone can help me in conversion of query to teradata

1.

isnull(ACC_DET.user_name,' ') as usr

2.

isnull(MAX(isnull(ACCESS_DATE,'')),' ') as max_access

3.

datediff(day, access_date , (select max(access_date) from cess_details )) < 90
1 REPLY
Senior Apprentice

Re: Conversion of SQL server query to teradata query

Hi Rahul,
ISNULL is proprietary, replace it with COALESCE, which is also supported by MS SQL Server. There are some minor differences, but you don't have to care about it in that case:

COALESCE(ACC_DET.user_name,' ') as usr

COALESCE(MAX(COALESCE(ACCESS_DATE,'')),' ') as max_access
Is access_date really a string and not a datetime?

DATEDIFF might be replaced by Standard SQL interval calculation, if it's in DAYs then it's even easier:
access_date > (select max(access_date) from cess_details ) - 90

Dieter