This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 9th, 2013  |  syntax: None  |  size: 0.55 KB  |  views: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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()"
clone this paste RAW Paste Data