Home Forums SQL Server 2008 T-SQL (SS2K8) How to split the date format into month with year? RE: How to split the date format into month with year?

  • raghuldrag (12/31/2013)


    i need the output like

    for example 2013-04-01 is in table my expectation output is 04-2013 (extract month with year)......

    Hi.

    This seems to be a relatively simple single SELECT statement.

    Please use DATEPART to convert billed_date into a year with yyyy, and a second datepart to get the month with mm.

    Then group your query the way you need to summarize the data, using SUM to add up values.

    Thanks

    John.