need help running a query to get the current date

  • I am having trouble getting this query to work. I hope someone can help. I may just be missing something obvious. I work in a call center. We use an application called TotalView to set up staffing schedules. I need to query this application. I can connect to it through a SSIS package using an ADO.NET data source. The application requires a driver called Simba.

    So here's my problem. I'm trying to run this query:

    select *

    from schedheader

    where modify_date_time >= GETDATE() -1

    And I get this error:

    Error at get schedule header [ADO NET Source [1]]: System.Data.Odbc.OdbcException: ERROR [42000] [SimbaLNA][Simba][SimbaEngine ODBC Driver]Invalid scalar function: GETDATE.

    at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)

    at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)

    at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader)

    at System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior)

    at System.Data.Odbc.OdbcCommand.ExecuteDbDataReader(CommandBehavior behavior)

    at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)

    at Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.ReinitializeMetaData()

    at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostReinitializeMetaData(IDTSManagedComponentWrapper100 wrapper)

    So it seems that either the ADO.NET data source or the Simba driver doesn't recognize the GETDATE() statement. The query runs fine when I enter a real short date like '2009-09-01'.

    Does anyone know how to get the current date into a query using this driver or data source? I can't use a variable because the ADO.NET source doesn't have the option to set up parameters, unlike the OLE source.

    thank you

  • This was removed by the editor as SPAM

  • You need to find out what database product that this application is using. the simba driver is a generic driver.

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply