﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / Working with Oracle  / Order dates in DESC order, starting with current Month/Year / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 16:48:50 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Order dates in DESC order, starting with current Month/Year</title><link>http://www.sqlservercentral.com/Forums/Topic1433328-1044-1.aspx</link><description>[quote][b]5280_Lifestyle (3/20/2013)[/b][hr]I'm trying to get month and year output for an SSRS report using an Oracle data source for use as a multiple value parameter; the user can select dates such as February 2013, January 2013, October 2012. My current query does that, but it does not start at February 2013, it starts at December 2013. The MONTH_YEAR field is populated with month/year up to December 2050, which is why I'm trying to limit the parameter's starting date to choose from the current month and year.(I was going to post this in Reporting Services, but since it's the Oracle code that I want altered this seemed a more appropriate location.)[code="sql"]SELECT DISTINCT MONTH_YEAR	FROM   EDL.V_CLNDRWHERE   SUBSTR(MONTH_YEAR,1,INSTR(MONTH_YEAR,' ')-1) &amp;lt;= TO_CHAR(SYSDATE,'Month')   AND   SUBSTR(MONTH_YEAR, -(LENGTH(MONTH_YEAR) - INSTR(MONTH_YEAR,' ')), (LENGTH(MONTH_YEAR) - INSTR(MONTH_YEAR,' '))) &amp;lt;= TO_CHAR(SYSDATE,'YYYY')ORDER BY 	SUBSTR(MONTH_YEAR, -(LENGTH(MONTH_YEAR) - INSTR(MONTH_YEAR,' ')), (LENGTH(MONTH_YEAR) - INSTR(MONTH_YEAR,' '))) DESC,	TO_DATE(UPPER(SUBSTR(MONTH_YEAR,1,INSTR(MONTH_YEAR,' ')-1)),'MONTH','nls_date_language=american') DESC[/code][/quote]This might be a bit over engineered, would you please mind to share the definition of MONTH_YEAR column as well as an example of how data looks like there?</description><pubDate>Fri, 22 Mar 2013 11:27:19 GMT</pubDate><dc:creator>PaulB-TheOneAndOnly</dc:creator></item><item><title>Order dates in DESC order, starting with current Month/Year</title><link>http://www.sqlservercentral.com/Forums/Topic1433328-1044-1.aspx</link><description>I'm trying to get month and year output for an SSRS report using an Oracle data source for use as a multiple value parameter; the user can select dates such as February 2013, January 2013, October 2012. My current query does that, but it does not start at February 2013, it starts at December 2013. The MONTH_YEAR field is populated with month/year up to December 2050, which is why I'm trying to limit the parameter's starting date to choose from the current month and year.(I was going to post this in Reporting Services, but since it's the Oracle code that I want altered this seemed a more appropriate location.)[code="sql"]SELECT DISTINCT MONTH_YEAR	FROM   EDL.V_CLNDRWHERE   SUBSTR(MONTH_YEAR,1,INSTR(MONTH_YEAR,' ')-1) &amp;lt;= TO_CHAR(SYSDATE,'Month')   AND   SUBSTR(MONTH_YEAR, -(LENGTH(MONTH_YEAR) - INSTR(MONTH_YEAR,' ')), (LENGTH(MONTH_YEAR) - INSTR(MONTH_YEAR,' '))) &amp;lt;= TO_CHAR(SYSDATE,'YYYY')ORDER BY 	SUBSTR(MONTH_YEAR, -(LENGTH(MONTH_YEAR) - INSTR(MONTH_YEAR,' ')), (LENGTH(MONTH_YEAR) - INSTR(MONTH_YEAR,' '))) DESC,	TO_DATE(UPPER(SUBSTR(MONTH_YEAR,1,INSTR(MONTH_YEAR,' ')-1)),'MONTH','nls_date_language=american') DESC[/code]</description><pubDate>Wed, 20 Mar 2013 10:11:37 GMT</pubDate><dc:creator>5280_Lifestyle</dc:creator></item></channel></rss>