Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 14th, 2008, 09:17 PM
Registered User
 
Join Date: Jun 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default get date difference

I need help to those who have well knowledge in msaccess, my concern right now is on how to get date difference from date and with the number of days given.
  example: date is 01/25/2008
           number of days given is 10 days
           01/25/2008 - 10 days in order to result 01/15/2008

can anyone can help me pls.....

thanks
Ben


 
Old January 16th, 2008, 09:33 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Where are you generating this date difference? If in a query, you can do:

SELECT RecordID, RecordName, RecordStartDate, RecordEndDate, DateDiff("d", RecordStartDate, RecordEndDate) As Days FROM MyTable

If you want the number of days from the record date to today, you can do this:

SELECT RecordID, RecordName, RecordStartDate, RecordEndDate, DateDiff("d", RecordStartDate, Date()) As Days FROM MyTable

You can put similar code on a form event etc.

Did that help?



mmcdonal

Look it up at: http://wrox.books24x7.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Date difference surya Javascript How-To 2 September 19th, 2008 12:42 AM
Date Difference Help saf01 Crystal Reports 0 September 29th, 2005 05:35 AM
Difference between Date and Now() marcin2k Access VBA 3 September 8th, 2005 01:05 PM
Date difference. rupen Classic ASP Basics 6 July 21st, 2005 06:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.