Results 1 to 9 of 9
  1. #1
    cgoodday is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2023
    Location
    Anbuja
    Posts
    4

    Countdown from Original Date

    Hi guys.
    I have a query with date of deposit and date of payment
    Between date of deposit and payment is 30 days


    i.e my clients pay for for their trade and I am expected to pay them back their capital and profit in 30days time
    So, date of them paying in is called "DepositDate" and date of paying them back with their accrued interest is called "PaymentDate"
    Between these two dates, I have a duration of 30 days
    I need to create a field in the query to be counting down from the 30 days to 0 days as a daily reminder.
    Thanks.
    I hope I make sense

  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,521
    Perhaps:

    30 - DateDiff("d", DepositDate, Date())
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    cgoodday is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2023
    Location
    Anbuja
    Posts
    4
    Thanks for replying
    This is what it supposed to be based on ur reply
    CountDown: 30-DateDiff("d",[Date],[PaymentDate]())
    However, when I try executing it, I receive the below error

    And if I remove () from after paymentdate, it runs well but with the below value

    I know its supposed to be about 28 instead of 0
    Hope I make sense
    Thanks

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    There's no error shown, but did you try what I suggested, exactly? You have it backwards I believe, and the parentheses need to be after "Date", though Access sometimes drops them. You can't have the brackets around Date, or it thinks it's a field rather than the function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    cgoodday is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2023
    Location
    Anbuja
    Posts
    4
    Yes, I did
    I pasted the images but to my surprise, as u sent ur reply now. I observed the image did not send
    However, I did another trick by creating Now() field and created another field called countdown and subtracted the payment date from the now field and it worked

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'm glad you have it working, though it sounds like an unnecessary workaround.

    You can't just paste in an image on this forum, it must be attached:

    https://www.accessforums.net/showthread.php?t=70301
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    cgoodday is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2023
    Location
    Anbuja
    Posts
    4
    Thank you very much

  8. #8
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    This site gives the impression you can paste like other sites as it is visible after pasting, but is removed after submitting.

    Wonder what genius though of that?

    Imagine doing something similar in an access db, allowing a user to do something, show them the result, and remove it when they go to the next record.
    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

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I agree. Presumably the genius is employed by vBulletin and doesn't actually use the software.
    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. timer countdown
    By DMT Dave in forum Access
    Replies: 1
    Last Post: 06-04-2020, 09:26 AM
  2. countdown with reset
    By slimjen in forum Forms
    Replies: 10
    Last Post: 10-08-2019, 08:10 AM
  3. Replies: 1
    Last Post: 06-13-2016, 12:07 PM
  4. Countdown Date??
    By access2015 in forum Queries
    Replies: 1
    Last Post: 06-17-2015, 03:52 AM
  5. Replies: 11
    Last Post: 06-19-2012, 01:08 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