Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

How to find out the date difference from an access database table?

Hi Experts,
I have a table that collects date shortdate (every day when users login).
For example:
3/17/2006
3/18/2006
3/19/2006
3/20/2006
3/21/2006

I need a VB function to find out the date difference between the last record which is 21 ,20 and .... 17. for 15 days of the month.
0
bryanche
Asked:
bryanche
  • 3
  • 3
1 Solution
 
suprapto45Commented:
Hi,

Can't you use DateDiff function available in VB?

http://www.vb-helper.com/howto_ellapsed_time.html

David
0
 
bryancheAuthor Commented:
Thanks! That's a good example. But I'd like to have the difference between range of dates from 1 to 15 records.
0
 
bryancheAuthor Commented:
Experts!
I think I found it out myself. Here's what I have.

Dim DateDiff As Integer
Dim iRow As Integer

Dim intRecCount As Integer
Dim datStartDate As Date
Dim datFinishDate As Date

With Rs
    .MoveLast
    datFinishDate = !LOGOUT_DATE
    .MoveFirst
    datStartDate = !LOGOUT_DATE
    intRecCount = .RecordCount
    For iRow = 1 To intRecCount
        DateDiff = datFinishDate - datStartDate
    Next iRow
End With

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
bryancheAuthor Commented:
Dear Moderators,
Thanks for suprapto45. But I found my answer myself. So please close my question and refund my points if possible.
0
 
suprapto45Commented:
Hi,

I am okay with it...refund. Please post your request to refund your question in Community Support TA.

David
0
 
suprapto45Commented:
Please let me know if you do not know how to do it. I will request it for you

David
0
 
DarthModCommented:
PAQed with points refunded (125)

DarthMod
Community Support Moderator
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now