how to display data from current time to before current time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JuAn2226
    New Member
    • Mar 2008
    • 27

    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
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Please pass more information.

    Comment

    • JuAn2226
      New Member
      • Mar 2008
      • 27

      #3
      Originally posted by debasisdas
      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
      [code=vb]
      Private Sub Form_Load()
      FillFlex

      End Sub

      Private Sub FillFlex()
      On Error Resume Next
      Dim lAvg As Long, iCOunt As Integer
      Dim intTime As Date

      strSql = "SELECT CarID, TimeIn, TimeOut, TimeDuration, Speed" & _
      " FROM Car_Details" ' WHERE CarTime >=cdate('2008-03-31 7:00')"


      iCOunt = 0
      FlxRs.Open strSql, DE.Conn, adOpenForwardOn ly, adLockReadOnly
      Flex.Rows = 1
      If FlxRs.RecordCou nt > 0 Then

      For i = 1 To FlxRs.RecordCou nt
      Flex.Rows = Flex.Rows + 1
      Flex.TextMatrix (i, 0) = FlxRs(0)
      Flex.TextMatrix (i, 1) = FlxRs(1)
      Flex.TextMatrix (i, 2) = FlxRs(2)
      Flex.TextMatrix (i, 3) = FlxRs(3)
      If FlxRs(2).Value <> "" Then
      iCOunt = iCOunt + 1
      End If
      Flex.TextMatrix (i, 4) = FlxRs(4)

      FlxRs.MoveNext

      lAvg = lAvg + Flex.TextMatrix (i, 4) '= FlxRs(3)
      lAvg = Math.Round(lAvg , 2)
      Next i
      lblNum.Caption = iCOunt
      lblAverage.Capt ion = lAvg / lblNum
      lblAverage.Capt ion = Math.Round(lblA verage.Caption, 2)
      Else
      lblNum.Caption = ""
      End If
      FlxRs.Close

      End Sub[/code]
      Last edited by debasisdas; Apr 17 '08, 10:56 AM. Reason: added code=vb tags

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        What is the problem with the code ?

        is the Where clause is the part of your query ?

        Comment

        • JuAn2226
          New Member
          • Mar 2008
          • 27

          #5
          Originally posted by debasisdas
          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.

          Comment

          Working...