SHARE
TWEET

Untitled

a guest Feb 9th, 2013 25 Never
  1. Dim Sql, CurrentDate as String
  2.  
  3. Dim TrDate as Date
  4.  
  5. Dim DataVal As Integer
  6.  
  7. TrDate=DateTime.Now
  8.  
  9. CurrentDate=Format(TrDate, "dd/MM/yyyy hh:mm:ss tt")
  10.  
  11. Sql="Select count(*) from Table1 where InvDate<=#" & CurrentDate & "#"
  12.  
  13. IF DBConOpen()=True
  14.  
  15.         cmdOledb.CommandText = sql
  16.          cmdOledb.CommandType = CommandType.Text
  17.          cmdOledb.Connection = ConOledb
  18.          DataVal = cmdOledb.ExecuteScalar
  19.          msgbox(DataVal)
  20.  
  21. End IF
  22.        
  23. CurrentDate=Format(TrDate, "yyyy/MM/dd hh:mm:ss tt")
  24.        
  25. Sql="Select count(*) from Table1 where InvDate<=Now()"
RAW Paste Data
Top