Results 1 to 3 of 3
  1. #1
    mmart33 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    23

    Based on a date in a form, return First of Fiscal Month based on FiscalMonthTable

    I have a table that has our fiscal months with a BeginningDate and End Date that equals a fiscal month (for example, JAN 2013 - Beginning = 12/29/12, Ending Date is 2/1/13)

    When a date is selected in a form, I want to reference this date in a query. I want my FiscalMonthTable to determine which fiscal month the date lies in. I then want to create a field that generates the BeginningDate for that FiscalMonth.

    I will use this to determine the FiscalMonthToDate totals for a report. I know how to use DateSerial to get First of Month and First of Year, but I need our custom First of Fiscal Month and Fiscal Year.



    Thanks!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    One way to do this is with DLookup() domain aggregate function.

    DLookup("month field", "FiscalMonthTable", "#" & [date value] & "# BETWEEN [Beginning] AND [Ending]")

    or

    DLookup("Beginning", "FiscalMonthTable", "#" & [date value] & "# BETWEEN [Beginning] AND [Ending]")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    mmart33 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    23
    This worked perfectly. Thanks!

    Quote Originally Posted by June7 View Post
    One way to do this is with DLookup() domain aggregate function.

    DLookup("month field", "FiscalMonthTable", "#" & [date value] & "# BETWEEN [Beginning] AND [Ending]")

    or

    DLookup("Beginning", "FiscalMonthTable", "#" & [date value] & "# BETWEEN [Beginning] AND [Ending]")

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

Similar Threads

  1. Return result based on %
    By Guitarzan in forum Access
    Replies: 1
    Last Post: 08-08-2012, 09:18 AM
  2. Replies: 3
    Last Post: 04-01-2012, 01:40 PM
  3. Return field value based on the same table
    By snoopy2003 in forum Queries
    Replies: 2
    Last Post: 03-05-2011, 02:45 AM
  4. Replies: 1
    Last Post: 03-01-2011, 04:03 PM
  5. Replies: 1
    Last Post: 04-15-2010, 02:07 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