Results 1 to 3 of 3
  1. #1
    rayted is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2016
    Posts
    34

    Input date and return value

    Hi guys,



    Can anyone guide me on writing the SQL for:

    [Please input date] and then the user adds the date in mm/dd/yyyy format and the value returned should be 28 (days) - the input (so I want to show the due date)

    Thank you!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    dont write sql, make a query.
    the query would look at a form with 2 dates; txtStartDate, txtEndDate

    txtStartDate is where the user enters the date.
    the txtEnd date formula = DateAdd("d",28,txtStartDate) '(or -28 if you want)

    the query would be:
    select * from table where DateFld between forms!myForm!txtStartDate and forms!myForm!txtEndDate

  3. #3
    rayted is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2016
    Posts
    34
    Hi Ranman

    Thank you for your reply.

    Do you mean create a basic form and using a 'text box' as part of the form? Or do I need something else for the user to input the date? and similarly what box and where do I input the formula? in the properties box?

    thanks!

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

Similar Threads

  1. date/time input mask and date ordering
    By jsberry in forum Database Design
    Replies: 1
    Last Post: 06-19-2017, 01:04 PM
  2. Replies: 2
    Last Post: 04-10-2017, 10:57 AM
  3. Return Date Based On Another Date
    By seantnash in forum Queries
    Replies: 2
    Last Post: 08-15-2016, 07:40 AM
  4. Replies: 2
    Last Post: 09-23-2014, 11:32 AM
  5. Replies: 3
    Last Post: 04-01-2012, 01:40 PM

Tags for this Thread

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