Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004

    Exclamation Unanswered: Expression builder help. Month Name to Number

    This was posted earlier, thought I had a solution but it did not work with my application. becuae i cannot use modules in the query with ODBC (did'nt know that till to late)

    I have an Access database query with a month column (with full names of months in them) . I need to build an expression that will take

    DECEMEBER and make it 12
    November and make it 11
    October and make it 10 and so on.

    I tried this and it worked for 1 month at a time ****** Expr1: IIf([month]="January","1") ****** but how would I format it to make all the months corespond with the right number?

    The table value is not a month field it is a text field. so I don't think any of the date variables will work. I hope this is simple one for you access guys out there. I really need some help on this one. 10 hours I have been working on tis .... I am drained

  2. #2
    Join Date
    Dec 2004
    Found the solution...... YAAAA!

    MN: IIf([month]="January","1",IIf([month]="December","12",IIf([month]="February","2",IIf([month]="March","3",IIf([month]="April","4",IIf([month]="May","5",IIf([month]="June","6",IIf([month]="July","7",IIf([month]="August","8",IIf([month]="September","9",IIf([month]="October","10",IIf([month]="November","11"))))))))))))

    Just drop that in the expression builder!

  3. #3
    Join Date
    Sep 2004
    Charlotte, NC
    No need to put all of those nested IF statements in. Try this:

    CInt(Month([Month] & " 1, 2004"))


Posting Permissions

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