SQL Server Development Bookmark and Share   
 index > SQL Server Integration Services > Problem using DBTIMESTAMP data type date field in a query.
 

Problem using DBTIMESTAMP data type date field in a query.

Hello,

I have a query that was ported from Excel to pull data from CACHE database. Part of the query is below:

LN_APP.action_dt={d '2009-02-11'}

Whenever I use a date function as below, I either get an SQL command errror or I get NULL data extraction. I'm aware that CACHE database uses the DBTIMESTAMP data type format for dates.

What I'm trying to do is to extract the data using SSIS into SSRS. I'm now thinking of using either a derived column or data transformation in the package, though I'm not sure how to proceed. Can somebody help?

LN_APP.action_dt=dateadd('dd',-5,getdate())) ==== I get NULLS

LN_APP.action_dt={d 'dateadd('dd',-5,getdate())'} ==== I get an SQL error

Thanks,

OokoJ
OokoJ  Wednesday, February 18, 2009 4:58 PM
It's me still ... I needed to add that probably the biggest challenge in the extraction is that CACHE database parses the Dateadd function slightly differently from SQL server:

CACHE: dateadd ('dd', -1, getdate())
SQL: dateadd (dd, -1, getdate())

The difference is the use or no use of apostrophes on the ‘dd�datepart.

Thanks again,

OokoJ
OokoJ  Wednesday, February 18, 2009 6:22 PM

You can use google to search for other answers

Custom Search

More Threads

• Send Email task problem
• Help with Lookup
• Problem Getting Dynamic File Connection Information After task Deployed to Server
• reading xml using exe sql task
• unable to add reference to Microsoft Excel in VSA
• Any error in a Data Flow Task makes my package stop
• Success arrows -- moving them?
• ScriptTask and Foreach Loop Container
• Parallelism in SSIS
• Path to configuration files