consulta no me repita los meses teniendo una fecha aaa/mm/dd

All replies

  • Hi CarolinaSR,

    This is an English forum, you can ask your question on your local forum. I translated your question with Bing and get the following result:

    query not I repeat the months having a date dd/mm/aaa
    How do I query where not I repeat the months taking a date dd/mm/aaa

    Do you want to get month value from a date type data? If so, please refer to the following codes:

    declare @DateTest date;
    set @DateTest = GETDATE();
    select MONTH(@DateTest) as [Month];
    If this is not what you want, please provide more details here for analysis.

    Allen Li
    TechNet Community Support

    Wednesday, June 26, 2013 10:02 AM
  • Que pena haberlo colocado en castellano... traduciré lo siguiente:

    Muchas gracias por la respuesta.. si funciona pero también necesito que me salga con el año,  que no solo distinga de meses sino con el año , ya que si tiene mes 05 en 2012 y en 2013, solo sale 05 y esto no es lo adecuado

    Agradesco la atencion prestada

    Too bad you've placed in Castilian ... translate the following:

    Thank you very much for the reply .. if it works but I need to go through the year, not just months but apart from the year, because if you have 05 months in 2012 and 2013, only goes 05 and this is not suitable

    Thanks for the great attention given

    Friday, June 28, 2013 8:08 PM