Results 1 to 15 of 15
  1. #1
    Titch is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    8

    Date Adding


    Hi, I'm setting a database up to enable me to follow up customer orders after delivery. I have the tables set up and the delivered date as a date/time field along with follow up 1 week, 1 month and 3 month being set as date/time field. I am wanting these to populate automatically based on delivered date so that I can create a report to make follow up easier. However, using the DateAdd doesn't work, I've tried this in a query and in a report. Would anyone be able to help me please. It is a very long time since I was working with Access and I've tried everything I can remember but nothing is working. I have attached a screenshot of my main table to give an idea of what I have set up and want to do.table screen shot.zip

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by Titch View Post
    ...... However, using the DateAdd doesn't work, I've tried this in a query and in a report. Would anyone be able to help me please. ....
    First of all, telling us that it doesn't work will help nobody. If it worked you wouldn't be asking for help. Posting the Code/Expression that you are using would helpful.

    Secondly, it sounds like you want to save these calculated dates to a table which is not usually considered to be best practice. Usually better to do the calculation whenever and wherever it is required.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    use DATEADD("d",3,[eventdate])
    (add 3 days. or other time interval: yyyy,m,w,d,h,n

    or DATEDIFF("h",date1,date2)
    how many hrs different

  4. #4
    Titch is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    8
    Quote Originally Posted by Bob Fitz View Post
    First of all, telling us that it doesn't work will help nobody. If it worked you wouldn't be asking for help. Posting the Code/Expression that you are using would helpful.

    Secondly, it sounds like you want to save these calculated dates to a table which is not usually considered to be best practice. Usually better to do the calculation whenever and wherever it is required.
    I have used DATEADD("d",7,[DeliveredDate]) - copy of screenshot attached. When I use this in the query it asks for the delivered date which then populates the field regardless of delivery date with 7 days from the date I enter (previously it didn't do this, it just returned error or blank query results).
    I am wanting to use the query - not necessary fill the existing field (although that would be nice) as I can do that manually when I do the follow up - but to be able to create a report that I can run each week to check which customers I need to follow up with.
    Hope this clarifies what I'm wanting to do.
    query screen shot.zipquery screen shot.zip

  5. #5
    Titch is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    8
    Thank you, I tried that and yesterday did not work at all, this morning it partially works but if you see the screen shots I added in reply to Bob, it fills dates even for blank fields

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,944
    If access asks for DeliveredDate, then that field does not exist or you have misspelled it?
    As you have supplied a random date, then the date calculated will always be the same? 7 days later than what you typed in.

    I have not looked at the pic, as i do not want to go through the rigmarole of downloading a zip file, unzipping just to be able to view the pic.
    You can attach the pic directly, and I cannot imagine the pic is huge, so size considerations should not matter.?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    Titch is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    8
    OK, this is the table the query is based on

    and this is the query I have used

  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,521
    Post 7 was moderated, I'm posting to trigger email notifications.

    The attachments do not appear to have come through. Try attaching them again.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Titch is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    8
    Click image for larger version. 

Name:	query screen shot.jpg 
Views:	10 
Size:	15.6 KB 
ID:	45254Click image for larger version. 

Name:	table screen shot.jpg 
Views:	10 
Size:	110.8 KB 
ID:	45255
    Hopefully both will show now

  10. #10
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,944
    OK [DeliveredDate] is actually [Delivered Date]

    Not a great idea to have spaces in fieldnames.?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  11. #11
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Your table design is very wrong - you have multiple repeating fields and other things inherent when someone has "Spreadsheeted" a table.
    Your orders table should have child table of order Lines, that way if you have 1 product or 100 the design accommodates it.

    Samples and follow up's should equally be child records or seperate tables linked back to the main top level record.

    Have a read up about normalisation and converting spreadsheets into Access.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  12. #12
    Titch is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    8
    thank you, I'll look at amending

  13. #13
    Titch is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    8
    Thank you, I'll have a look at that. With the existing format, will I be able to convert it into the right format easily rather than re-entering the information

  14. #14
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    As a one off process, yes just take a bit of fiddling with.

    All the follow up dates can be calculated from the order or delivery date, so as others have stated don't store those.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  15. #15
    Titch is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    8
    Quote Originally Posted by Minty View Post
    As a one off process, yes just take a bit of fiddling with.

    All the follow up dates can be calculated from the order or delivery date, so as others have stated don't store those.
    Thanks, I'll look at updating

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

Similar Threads

  1. Replies: 3
    Last Post: 03-05-2019, 06:48 PM
  2. Adding a letter after a date
    By Sturgis76 in forum Forms
    Replies: 1
    Last Post: 04-05-2017, 06:19 PM
  3. Replies: 7
    Last Post: 10-19-2016, 11:11 AM
  4. Adding a value depending on date
    By Access_Novice in forum Queries
    Replies: 4
    Last Post: 03-19-2015, 05:53 PM
  5. Adding 'Last Edited' Date
    By vCallNSPF in forum Forms
    Replies: 2
    Last Post: 12-16-2009, 04:36 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