Results 1 to 10 of 10
  1. #1
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102

    Show month in report

    Hello everyone,


    I have in my report this code: = Month(Now()).
    This code shows only the number of the month so, for example: September = 9.
    But I want the report to show "September".


    How can I do this?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,570
    Look at the Format() function
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102
    if i put "mmmm" into the Format function it shows me January but i want the current month.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,570
    So use the current date?
    However Now() should work just as well?

    Code:
    ? format(now(),"mmmm")
    September
    So I have no idea what your are using?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Join Date
    Apr 2017
    Posts
    1,792
    OP is using the result of MONTH(Now()), i.e. in September it will be 9. And when OP uses this result with FORMAT, he/she formats 9th January 1900 as month, what of-course is returning "January"!

    For OP: In Access and in Excel, dates are integers starting from 01.01.1900. Decimal parts of any date value are time values (hours, minutes and seconds) of this date. I.e. 1.5 is same as 01.01.1900 12:00, 2.75 is same as 02.01.1900 18:00, etc.

  6. #6
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    MonthName(Month(now))

    will work without format function.

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,570
    Quote Originally Posted by davegri View Post
    MonthName(Month(now))

    will work without format function.
    Usually more than one way to skin the cat with computer programming.
    Personally I would go with the option with the least functions.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  8. #8
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    Personally I would go with the option with the least functions.
    A good route to take for sure.

  9. #9
    Join Date
    Apr 2017
    Posts
    1,792
    I haven't access to MS Office at moment to test it, but how about having a control on report with formula =NOW() as source, and the control formatted as "mmmm"?

  10. #10
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,425
    Trying to imagine why I'd want this on a report that when I run it on 10/31/2022 the calc shows October, but I run the same report the next day and it shows November. - especially if the records contain a date. If the month info is for data, the date ought to be in the data, but I guess that doesn't matter here for some reason.

    A control formatted as mmmm with source as Now() would work also.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Show payments every month
    By shod90 in forum Access
    Replies: 1
    Last Post: 08-26-2020, 12:54 PM
  2. Replies: 2
    Last Post: 06-14-2016, 02:36 PM
  3. Replies: 1
    Last Post: 03-29-2014, 10:19 AM
  4. Query to show averages by month
    By DDEB in forum Queries
    Replies: 3
    Last Post: 05-08-2012, 05:11 PM
  5. show records in this month last year?
    By geoffcox in forum Queries
    Replies: 4
    Last Post: 06-11-2011, 07:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums