Hi,
Could nayone help. I'm trying to query our sever for data based on a date/range but I cannot get it to work I get an ODBC call failed which usually means the SQL is wrong. I know the date should be the number of days since 31/12/1899 date-1 = 38593.
Can anyone help?? Code attached.
Dim sngTimer As Single
sngTimer = Timer
Dim wrkODBC As Workspace
Dim conODBC As Connection
Dim rs As Recordset
Dim dblDate As Double
Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "admin", "", dbUseODBC)
'Set conODBC = wrkODBC.OpenConnection("CMSCon", , , "ODBC;DSN=CMSDERBY_ODBC;UID=" & strUsername & ";PWD=" & strPassword & ";ServerType=Informix 2000;Host=cms_derby;Port=5000;Database=cms;Options=;Driver=C:\Program Files\OpenLink\olod4032.dll;FetchBufferSize=30;NoLoginBox=No;Protocol=TCP/IP;ReadOnly=No;ServerOptions=;DeferLongFetch=Yes")
strSQL = "SELECT row_date, Split, callsoffered, dequecalls, acdcalls, abncalls, acceptable " & _
"FROM hsplit; " & _
"HAVING row_date = 38593"
Set rs = conODBC.OpenRecordset(strSQL)
Could nayone help. I'm trying to query our sever for data based on a date/range but I cannot get it to work I get an ODBC call failed which usually means the SQL is wrong. I know the date should be the number of days since 31/12/1899 date-1 = 38593.
Can anyone help?? Code attached.
Dim sngTimer As Single
sngTimer = Timer
Dim wrkODBC As Workspace
Dim conODBC As Connection
Dim rs As Recordset
Dim dblDate As Double
Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "admin", "", dbUseODBC)
'Set conODBC = wrkODBC.OpenConnection("CMSCon", , , "ODBC;DSN=CMSDERBY_ODBC;UID=" & strUsername & ";PWD=" & strPassword & ";ServerType=Informix 2000;Host=cms_derby;Port=5000;Database=cms;Options=;Driver=C:\Program Files\OpenLink\olod4032.dll;FetchBufferSize=30;NoLoginBox=No;Protocol=TCP/IP;ReadOnly=No;ServerOptions=;DeferLongFetch=Yes")
strSQL = "SELECT row_date, Split, callsoffered, dequecalls, acdcalls, abncalls, acceptable " & _
"FROM hsplit; " & _
"HAVING row_date = 38593"
Set rs = conODBC.OpenRecordset(strSQL)