Results 1 to 7 of 7
  1. #1
    cultofcargo is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2015
    Posts
    3

    Looking up a date in a table help

    I have a form where, a user enters a date and the form can return one of 3 values, determined from data in another table using a DLookUP.
    The data in the table has one date (the date where the season type begins) followed by the season.


    Is it possible to have it stored as a date range so that the formula looks at the date and goes down to the start date one lower, then returns the season?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    perhaps an example of the data as it exists in the tables and an example of what you want your query to look like. I am not following your description.

  3. #3
    cultofcargo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    3
    Hopefully this makes it all clear, i need it to find the season data when the date is not an exact match.
    Attached Thumbnails Attached Thumbnails Screenshot (65).png   Screenshot (64).png  

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    This gets tricky:

    DLookup("Season", "seasondates", "Dates=#" & DMax("Dates", "seasondates", "Dates<=#" & [firstnight_txt] & "#") & "#")

    Might want to review http://allenbrowne.com/ser-36.html
    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.

  5. #5
    cultofcargo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    3
    Sorry, can someone help further?
    what are the # referring to in the formula?

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    # indicates a date like ' or " indicates a text value.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    As rpeare indicated, the # is a delimiter for date parameter. Apostrophe (or a doubled quote mark) is text delimiter. Numbers and Booleans don't require any delimiter.
    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.

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

Similar Threads

  1. Replies: 1
    Last Post: 11-16-2014, 09:10 AM
  2. Replies: 1
    Last Post: 04-16-2014, 04:25 PM
  3. Replies: 7
    Last Post: 02-25-2014, 03:11 PM
  4. Replies: 3
    Last Post: 12-24-2013, 04:20 PM
  5. Replies: 3
    Last Post: 03-15-2013, 03:16 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