Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    23

    Unanswered: Access Query: Needs to convert/return user input from number to name of month

    Here's part of my code for my Access query:

    SELECT [Enter Month 1 - 12] AS ["Month"], Sum(IIf([ProductName] Like 'FHA30*',1,0)) AS ["FHA 30"]
    FROM Calculations2
    WHERE (((Month([LockDate]))=[enter month 1 - 12]));

    It works fine, but I'm wanting it to return the name of the month in the first column instead of the number that the user inputs. I have another table that simply has a column with the month number and a column with the month name so I thought I might be able to have a second select statment with somewhere with in the SELECT [Enter Month 1 - 12] AS ["Month"], part, but I don't know how to do that. I'm real slow when it comes to coding so any help is appreciated.

  2. #2
    Join Date
    Oct 2003
    Posts
    24
    Try this

    SELECT format(month([Enter Month 1 - 12]), "mmm") AS ["Month"]

  3. #3
    Join Date
    Oct 2003
    Posts
    24
    forget the first one I posted, these should work:


    returns the whole month.

    SELECT format([Enter Month 1 - 12] & "/1/1901", "mmmm") AS ["Month"]


    This returns the three letter month.

    SELECT format([Enter Month 1 - 12] & "/1/1901", "mmm") AS ["Month"]

  4. #4
    Join Date
    Nov 2003
    Posts
    23

    That worked!

    Thanks dude...works perfectly!

Posting Permissions

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