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

how to display data from current time to before current time

P: 27
Hi, can anyone help me [how to display data from current time to before current time].
when my program starts there is numbers and time will be display in the form of visual basic. it will run continuesly .My problem here is i dont know how to display the data 5min and before. Besides that i want to store this display for every 5 min and before. i already have database to store the number and time but not for every 5 min.should i create another database that just store data for 5min before. i already have one timer. Can i use another timer. plz help me. plz help with some example of coding
Apr 17 '08 #1
Share this Question
Share on Google+
4 Replies


debasisdas
Expert 5K+
P: 8,127
Please pass more information.
Apr 17 '08 #2

P: 27
Please pass more information.
This is my coding. My question here how i do i store information which been display in the Fillflex in to database.
i already has one database. is it ok if i add another one
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.     FillFlex
  3.  
  4. End Sub
  5.  
  6. Private Sub FillFlex()
  7. On Error Resume Next
  8. Dim lAvg As Long, iCOunt As Integer
  9. Dim intTime As Date
  10.  
  11.     strSql = "SELECT CarID, TimeIn, TimeOut, TimeDuration, Speed" & _
  12.         " FROM Car_Details" ' WHERE CarTime >=cdate('2008-03-31 7:00')"
  13.  
  14.  
  15.     iCOunt = 0
  16.     FlxRs.Open strSql, DE.Conn, adOpenForwardOnly, adLockReadOnly
  17.     Flex.Rows = 1
  18.     If FlxRs.RecordCount > 0 Then
  19.  
  20.         For i = 1 To FlxRs.RecordCount
  21.             Flex.Rows = Flex.Rows + 1
  22.             Flex.TextMatrix(i, 0) = FlxRs(0)
  23.             Flex.TextMatrix(i, 1) = FlxRs(1)
  24.             Flex.TextMatrix(i, 2) = FlxRs(2)
  25.             Flex.TextMatrix(i, 3) = FlxRs(3)
  26.             If FlxRs(2).Value <> "" Then
  27.                 iCOunt = iCOunt + 1
  28.             End If
  29.             Flex.TextMatrix(i, 4) = FlxRs(4)
  30.  
  31.             FlxRs.MoveNext
  32.  
  33.             lAvg = lAvg + Flex.TextMatrix(i, 4) '= FlxRs(3)
  34.             lAvg = Math.Round(lAvg, 2)
  35.         Next i
  36.         lblNum.Caption = iCOunt
  37.         lblAverage.Caption = lAvg / lblNum
  38.         lblAverage.Caption = Math.Round(lblAverage.Caption, 2)
  39.     Else
  40.         lblNum.Caption = ""
  41.     End If
  42.     FlxRs.Close
  43.  
  44. End Sub
Apr 17 '08 #3

debasisdas
Expert 5K+
P: 8,127
What is the problem with the code ?

is the Where clause is the part of your query ?
Apr 17 '08 #4

P: 27
What is the problem with the code ?

is the Where clause is the part of your query ?
sorry the problem is not in coding but how i store average speed (u will notice in my coding) to database.
Apr 17 '08 #5

Post your reply

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