×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

CMS ODBC Query

CMS ODBC Query

CMS ODBC Query

(OP)
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)

RE: CMS ODBC Query

concering your sql :

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

try "WHERE" instead ...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close