chiplarsen
IS-IT--Management
I have a DateTime field that I need to use in my Where statement. I need to use it as a Date. I want to say that a Charge Date is Date -1. That will give me yesterdays date. How do I convert the date time to date? Thank you
Code:
On Error Resume Next
Set cnSQL=CreateObject("ADODB.Connection")
cnSQL.Open "DSN=MMLIVE;UID=wl2817;PWD=wl2817"
Set rsMMLIVECHARGEVIEW=CreateObject("ADODB.Recordset")
rsMMLIVECHARGEVIEW.Open "Select * From HCS.Charges_View where PCU = 'GNE'" ,cnSQL
Do While Not rsMMLIVECHARGEVIEW.EOF
WScript.Echo rsMMLIVECHARGEVIEW("PCU")&" "&rsMMLIVECHARGEVIEW("Date of Charge")&" "&rsMMLIVECHARGEVIEW("DOSEQUANTITY")&" "&rsMMLIVECHARGEVIEW("CHARGE")
rsMMLIVECHARGEVIEW.MoveNext
Loop
'***** Close *****
cnSQL.Close
'*****