If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Convert db2 dates in open query Mode & insert into sql server 2000 table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-24-03, 04:39
sl_1234 sl_1234 is offline
Registered User
 
Join Date: Nov 2003
Posts: 1
Convert db2 dates in open query Mode & insert into sql server 2000 table

l'm trying to extract new cltnos on a daily basis from DB2 onto an sql server 2000 database.
l want to do the checking and exraction through
open query and insert the results into table A. This is the error that l get when l run this code


Server: Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing a query for execution against OLE DB provider 'MSDASQL'.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
(32-bit)][DB2/400 SQL]SQL0204 - CONVERT in *LIBL type *N not found.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' ICommandPrepare::Prepare returned 0x80040e14].

The desired result is when l compare the two l should get all the new clients for that day
But l don't know how to format the date and the time in Db2 so that l can get the daily
new clients using Today_date


SELECT Convert(Char(8),Getdate(),112) --:- result is 20031124
SELECT Convert(Char(8),Getdate(),112)+ ' 23:59:59.999' --:- result is 20031124 23:59:59.999



SELECT *

FROM OPENQUERY(Pumba,'SELECT
*
FROM ZALIVDTA.ZA10000P
Where TSD100 Between Convert(Char(8),TSD100 ,112) AND
Convert(Char(8),TSD100 ,112)+ ''23:59:59.999''
WITH UR')


This is how my dates in Db2 Look

Number CltNo Today_date Time
000001 10 2003/01/20 15:58:57
000002 29 1999/02/28 13:14:30
000003 37 1999/02/28 13:14:30
000004 53 1999/02/28 13:14:30
000005 61 1999/02/28 13:14:30
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On