Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CMS ODBC Query

Status
Not open for further replies.

DanMan1

Programmer
Dec 3, 2004
8
GB
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)
 
concering your sql :

"having" refers to groups-results not to detail-records.

try "WHERE" instead ...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top