469,620 Members | 1,857 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,620 developers. It's quick & easy.

how to display data from current time to before current time

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
4 1422
debasisdas
8,127 Expert 4TB
Please pass more information.
Apr 17 '08 #2
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
8,127 Expert 4TB
What is the problem with the code ?

is the Where clause is the part of your query ?
Apr 17 '08 #4
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.

Similar topics

7 posts views Thread by Neil Ginsberg | last post: by
13 posts views Thread by G | last post: by
11 posts views Thread by =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.