Results 1 to 10 of 10
  1. #1
    quinnb is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    9

    date criteria

    Hi i am running a query to pick up upcoming dates - a remider letter to be sent out when its 30 dAYS in the future
    BUT the database may not be used every day and i am scared an upcoming date will be missed - so how do i set a criteria of viewing dates between 24 & 30 days so this can be ran once per week as a task - so reminders sent out 30 days max to 23 days min (which is still a fair bit of time)


    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Use Between, the DateAdd() function and the Date() function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    quinnb is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    9
    Thankyou but can you give me the exact criteria pleaase - so weekly task - MOTS due between 24 and 30 days from now thanks

  4. #4
    Join Date
    Apr 2017
    Posts
    1,792
    1. In case you have back-end database on SQL Server (not SQL Server Express): A job runs once in a day, and executes a stored procedure, which queries database for entries due to reminder, and sends out e-mails;

    2. In case you have back-end database on SQL Server Express: a sheduled task runs once in a day, and executes a stored procedure in SQL Server Express database - further look p.1;

    3. In case you have splitted/nonsplitted database in MS Access entirely: You can use Windows sheduled task (on computer/server where your database is stored) to start your application (to avoid any surprises sometime at night), run a procedure there, and when procedure finishes, then close the application.

    I have used SQL Server jobs to send e-mails and SMS'es (to send out messages about production breakdowns automatically). I also have used Windows sheduled tasks to run pass-trough queries to get data from dbf-files (we have 64-bit SQL Sever, which doesn't have - and it looks lik it will not have it ever - FoxPro ODBC Driver, so we set up a 32-bit SQL Server Express for reading data). I have used sheduled tasks to activate Access database and to run a procedure there some 10 yeas ago - so I know at least, that it is possible too.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Does this help?

    DateAdd("d", 24, Date())
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    quinnb is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    9
    Quote Originally Posted by pbaldy View Post
    Does this help?

    DateAdd("d", 24, Date())
    Thankyou it does

  7. #7
    quinnb is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    9
    Sorry it didnt help - that just gives me 24 days in to the future - i would like 24 to 30 days please??

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    That was to give you the idea. It would be

    Between DateAdd(...) And DateAdd(...)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    quinnb is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    9
    Sorry i am being very thick i know - but entering that just gives me error messAGE
    what is the exact criteria please for 24 to 30 days?

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I've given you the overall structure and an example of the syntax for the DateAdd() function. All you need to do is put them together, and make the second one 30 instead of 24 days.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 21
    Last Post: 08-16-2016, 09:46 AM
  2. Replies: 2
    Last Post: 04-02-2015, 12:45 PM
  3. Replies: 20
    Last Post: 01-13-2015, 02:23 PM
  4. Date criteria using between and form date picker
    By killermonkey in forum Queries
    Replies: 3
    Last Post: 03-21-2013, 12:44 PM
  5. Replies: 3
    Last Post: 08-21-2012, 03:05 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