All Forums Enterprise
sktera 1 post Joined 07/08
21 Jul 2008
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

Adeel Chaudhry 448 posts Joined 04/08
21 Jul 2008

Hello,Can you please provide example of what you are trying to achieve?Regards,Adeel

-- If you are stuck at something .... consider it an opportunity to think anew.

mihir_ray07 10 posts Joined 10/08
14 Oct 2008

Please provide some details.

joedsilva 505 posts Joined 07/05
14 Oct 2008

If you are trying to get the month portion in the query, you can do this.SELECT EXTRACT(MONTH FROM DTE)FROM myTable

Rachamr 3 posts Joined 11/08
17 Nov 2008

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".

dnoeth 1921 posts Joined 11/04
17 Nov 2008

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

You must sign in to leave a comment.