Results 1 to 2 of 2

Thread: Get month name (Access 2003 and VB.NET)

  1. #1

    Thread Starter
    Hyperactive Member anna7's Avatar
    Join Date
    Sep 2005
    Location
    Catalonia
    Posts
    481

    Question Get month name (Access 2003 and VB.NET)

    Hi

    I have this query:

    SELECT month(fecha) AS mesFecha, MonthName(month(fecha)) AS nombreMes, year(fecha) AS yearFecha, sum(total) AS salesMonth
    FROM facturas
    GROUP BY Month(fecha), MonthName(month(fecha)), Year(fecha)
    ORDER BY month(fecha);
    ie, It returns these:
    1 January 2008 2300,00
    2 February 2008 3499,00
    5 May 2008 24901,11
    if I run this query from Access it runs ok. But when I'm trying to run it from an app Vb.NET 2003, it displays an error:

    "monthname is not defined"

    any help?

    regards

  2. #2
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: Get month name (Access 2003 and VB.NET)

    try with below query

    Code:
    SELECT month(fecha) AS mesFecha, FORMAT(fecha,"mmmm") AS nombreMes, year(fecha) AS yearFecha, sum(total) AS salesMonth
    FROM facturas
    GROUP BY Month(fecha), FORMAT(fecha,"mmmm"), Year(fecha)
    ORDER BY month(fecha);
    __________________
    Rate the posts that helped you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width