Need the distinct month date

UDA
N/A

Need the distinct month date

Hi All,

I have Date field, i want to use it as monthly.
Can any one of you let me the query for this.

Thanks in advance.

Regards,
SK
5 REPLIES
Teradata Employee

Re: Need the distinct month date

Hello,

Can you please provide example of what you are trying to achieve?

Regards,

Adeel
Enthusiast

Re: Need the distinct month date

Please provide some details.
Enthusiast

Re: Need the distinct month date

If you are trying to get the month portion in the query, you can do this.

SELECT EXTRACT(MONTH FROM DTE)
FROM myTable

Re: Need the distinct month date

Hi SK,

If you have date value field like this "2008-11-14", from this if you want only date value then the query like this "SELECT MONTH(Column_Name) FROM Table_Name".
Senior Apprentice

Re: Need the distinct month date

Hi Raghu,
don't use MONTH(x), because it's *not* Standard SQL, better use joedsilva's EXTRACT(MONTH FROM x).

MONTH(x) is ODBC SQL and will only work in SQL Assistant if "Allow Use of ODBC SQL Extensions in Queries" in Options -> Query is checked.
Neither CLI nor JDBC support that.

Dieter