Results 1 to 3 of 3
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Determine a term within a date range

    I'm wondering how in VBA to make a function that gets a term name/description if the date range falls within the same date range as the term



    so for example if the date is 1/8/2015 - 12/12/2015 then it is term 4

    if date from and date until between the above dates then = term 4

    not sure how I would make this out in VBA and I hope that it is fast (i.e. convert to clng() )

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Please describe Term and its attributes.
    I'm not sure from this Aug-Dec is a term??
    1/8/2015 - 12/12/2015 then it is term 4
    Does Term have a TermStart and TermEnd?
    What is data type?

    possibly
    if termStart >= RangeStart AND termEnd <=RangeEnd ???

    There is an example here.Old post
    Last edited by orange; 02-15-2015 at 10:40 AM.

  3. #3
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    check out the DATEPART Function (VBA), it can use 'q' as an interval. maybe what you need?

    1000 ways to skin a cat, allways looking for another one...
    Use MDB format for sample post. If your issue is fixed, mark the thread solved.
    Click on the star below if this has helped.

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

Similar Threads

  1. Replies: 10
    Last Post: 12-05-2014, 11:13 PM
  2. Replies: 2
    Last Post: 11-25-2014, 09:21 AM
  3. Determine which field has the newest date
    By Njliven in forum Queries
    Replies: 2
    Last Post: 08-14-2013, 10:28 AM
  4. Date range to determine rate
    By KevinMCB in forum Queries
    Replies: 5
    Last Post: 01-18-2011, 08:41 AM
  5. Using the date to determine if something was late.
    By lyrikkmashairi in forum Access
    Replies: 3
    Last Post: 11-02-2010, 10:59 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