By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,164 Members | 1,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,164 IT Pros & Developers. It's quick & easy.

Difference between today's date and a contract end date (positive and negative)

100+
P: 153
So now that I'm the office superstar in access, a.k.a. I barely know anything about access but I programmed a database that was extreemely helpful so I have once again been diverted from my semi-legal co-op and am programming another access database...but at least this time it has to do with contracts.

I'm wondering if there's a function that will simply allow me to count the number of days between a current date and a contract end date...but I have to know if the contract end date is before the current date so I can make note that the contract has ended. If anyone gets a chance, please let me know how to do this. I would really appreciate it. Thanks.

Cheers,
Kosmös
Dec 1 '06 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
So now that I'm the office superstar in access, a.k.a. I barely know anything about access but I programmed a database that was extreemely helpful so I have once again been diverted from my semi-legal co-op and am programming another access database...but at least this time it has to do with contracts.

I'm wondering if there's a function that will simply allow me to count the number of days between a current date and a contract end date...but I have to know if the contract end date is before the current date so I can make note that the contract has ended. If anyone gets a chance, please let me know how to do this. I would really appreciate it. Thanks.

Cheers,
Kosmös
You'll need something like this ....

Expand|Select|Wrap|Line Numbers
  1. Dim daysCompleted As Integer
  2. Dim daysToCompletion As Integer
  3.  
  4.    If endDate <= Date() Then
  5.       daysCompleted = DateDiff("d", "#" & Me.endDate & "#", Date())
  6.    Else
  7.       daysToCompletion = DateDiff("d", Date(), "#" & Me.endDate & "#")
  8.    End If
  9.  
Dec 1 '06 #2

100+
P: 153
You'll need something like this ....

Expand|Select|Wrap|Line Numbers
  1. Dim daysCompleted As Integer
  2. Dim daysToCompletion As Integer
  3.  
  4.    If endDate <= Date() Then
  5.       daysCompleted = DateDiff("d", "#" & Me.endDate & "#", Date())
  6.    Else
  7.       daysToCompletion = DateDiff("d", Date(), "#" & Me.endDate & "#")
  8.    End If
  9.  
Perfect! Thanks!
Dec 1 '06 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Perfect! Thanks!
You're welcome.

Mary
Dec 1 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.