Results 1 to 5 of 5
  1. #1
    Biplab1985 is offline Novice
    Windows 8 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    6

    Last Month Data Using Month Field, Access 2013

    Hello,

    I am trying to retrieve last month data using Month Field, I Do not have date field in the input data. I tried the below code but did not work.



    Code:
    SELECT * FROM Transpose WHERE Transpose.Month Between [Enter Month] and ([Enter Month]-1);


  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I Do not have date field in the input data
    What exactly are you comparing to what?

    Asking a clear question will often get you focused responses.

    Describe your situation/issue in simple, business terms. WHAT you are trying to accomplish.
    Show some sample "input/raw" data.
    Show us a sample of your expected output using the input data and the manipulation done on it.

    Good luck.

  3. #3
    Biplab1985 is offline Novice
    Windows 8 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    6
    I need the data of the Last Month, When i input Apr and 2014 it should get me result for March. Result attached

    I tried the below code but no luck

    Code:
    SELECT * FROM Transpose WHERE Transpose.Month Between [Enter Month] and ([Enter Month]-1);

    Attached Thumbnails Attached Thumbnails Data.jpg  

  4. #4
    InsuranceGuy is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Location
    Colorado
    Posts
    126
    Try this:

    Code:
    SELECT * FROM Transpose WHERE Transpose.[Month] = monthname(iif(Month([Month])-1<1,12,month([Month])-1))
    Best of luck,

    Jeff

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

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

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2016, 02:36 PM
  2. Replies: 2
    Last Post: 02-12-2015, 05:14 AM
  3. Replies: 5
    Last Post: 10-08-2014, 02:23 PM
  4. Replies: 6
    Last Post: 05-05-2014, 10:51 PM
  5. Replies: 5
    Last Post: 11-15-2010, 06:12 PM

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