how to get members of date dimension from current month

  • Hi ,

    my query is:

    select distinct calendarmonthkey, calendarmonth from dim.date

    order by calendarmonthkey

    Result:

    205801 jan 2058

    205802 feb 2058

    ....

    ....

    198001 jan 1980

    expected result is :

    201307 jul 2013

    201306 jun 2013

    201305 may 2013

    ......

    .....

    198001 jan 1980

    or else it can be starts with previous month(jun 2013).

    please suggest

    Regards,

    Niharika

  • you haven't specified the condition thats why you are getting values for all the year....

    Put a where clause too in your query....

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply