dbTalk Databases Forums  

AS400 & filter by date

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss AS400 & filter by date in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tomas Cerny
 
Posts: n/a

Default AS400 & filter by date - 03-31-2008 , 09:33 AM






Hello,

we need to import data from AS400 to MS SQL 2000 via ODBC driver (iSeries
ODBC by IBM).

The trouble is with date format and using functions such as NOW() or
GETDATE(). Using these function results in errors, because the ODBC driver
doesn't support these commands. But we need to upload data filtered by actual
date. AS400 date field is in fact a number.

So, the task is to compare (or filter in WHERE clause) number (AS400) with
system date (MS SQL)

Thanks for any help,

Tomas

Reply With Quote
  #2  
Old   
Rick Brandt
 
Posts: n/a

Default Re: AS400 & filter by date - 03-31-2008 , 07:12 PM






Tomas Cerny wrote:
Quote:
Hello,

we need to import data from AS400 to MS SQL 2000 via ODBC driver
(iSeries ODBC by IBM).

The trouble is with date format and using functions such as NOW() or
GETDATE(). Using these function results in errors, because the ODBC
driver doesn't support these commands. But we need to upload data
filtered by actual date. AS400 date field is in fact a number.

So, the task is to compare (or filter in WHERE clause) number (AS400)
with system date (MS SQL)

Thanks for any help,

Tomas
Can you not use the system DateTime on the AS400? That would be
CURRENT_DATE which you would then have to convert to the number format that
you can compare to your number field.





Reply With Quote
  #3  
Old   
Rick Brandt
 
Posts: n/a

Default Re: AS400 & filter by date - 03-31-2008 , 07:12 PM



Tomas Cerny wrote:
Quote:
Hello,

we need to import data from AS400 to MS SQL 2000 via ODBC driver
(iSeries ODBC by IBM).

The trouble is with date format and using functions such as NOW() or
GETDATE(). Using these function results in errors, because the ODBC
driver doesn't support these commands. But we need to upload data
filtered by actual date. AS400 date field is in fact a number.

So, the task is to compare (or filter in WHERE clause) number (AS400)
with system date (MS SQL)

Thanks for any help,

Tomas
Can you not use the system DateTime on the AS400? That would be
CURRENT_DATE which you would then have to convert to the number format that
you can compare to your number field.





Reply With Quote
  #4  
Old   
Rick Brandt
 
Posts: n/a

Default Re: AS400 & filter by date - 03-31-2008 , 07:12 PM



Tomas Cerny wrote:
Quote:
Hello,

we need to import data from AS400 to MS SQL 2000 via ODBC driver
(iSeries ODBC by IBM).

The trouble is with date format and using functions such as NOW() or
GETDATE(). Using these function results in errors, because the ODBC
driver doesn't support these commands. But we need to upload data
filtered by actual date. AS400 date field is in fact a number.

So, the task is to compare (or filter in WHERE clause) number (AS400)
with system date (MS SQL)

Thanks for any help,

Tomas
Can you not use the system DateTime on the AS400? That would be
CURRENT_DATE which you would then have to convert to the number format that
you can compare to your number field.





Reply With Quote
  #5  
Old   
Rick Brandt
 
Posts: n/a

Default Re: AS400 & filter by date - 03-31-2008 , 07:12 PM



Tomas Cerny wrote:
Quote:
Hello,

we need to import data from AS400 to MS SQL 2000 via ODBC driver
(iSeries ODBC by IBM).

The trouble is with date format and using functions such as NOW() or
GETDATE(). Using these function results in errors, because the ODBC
driver doesn't support these commands. But we need to upload data
filtered by actual date. AS400 date field is in fact a number.

So, the task is to compare (or filter in WHERE clause) number (AS400)
with system date (MS SQL)

Thanks for any help,

Tomas
Can you not use the system DateTime on the AS400? That would be
CURRENT_DATE which you would then have to convert to the number format that
you can compare to your number field.





Reply With Quote
  #6  
Old   
Rick Brandt
 
Posts: n/a

Default Re: AS400 & filter by date - 03-31-2008 , 07:12 PM



Tomas Cerny wrote:
Quote:
Hello,

we need to import data from AS400 to MS SQL 2000 via ODBC driver
(iSeries ODBC by IBM).

The trouble is with date format and using functions such as NOW() or
GETDATE(). Using these function results in errors, because the ODBC
driver doesn't support these commands. But we need to upload data
filtered by actual date. AS400 date field is in fact a number.

So, the task is to compare (or filter in WHERE clause) number (AS400)
with system date (MS SQL)

Thanks for any help,

Tomas
Can you not use the system DateTime on the AS400? That would be
CURRENT_DATE which you would then have to convert to the number format that
you can compare to your number field.





Reply With Quote
  #7  
Old   
Rick Brandt
 
Posts: n/a

Default Re: AS400 & filter by date - 03-31-2008 , 07:12 PM



Tomas Cerny wrote:
Quote:
Hello,

we need to import data from AS400 to MS SQL 2000 via ODBC driver
(iSeries ODBC by IBM).

The trouble is with date format and using functions such as NOW() or
GETDATE(). Using these function results in errors, because the ODBC
driver doesn't support these commands. But we need to upload data
filtered by actual date. AS400 date field is in fact a number.

So, the task is to compare (or filter in WHERE clause) number (AS400)
with system date (MS SQL)

Thanks for any help,

Tomas
Can you not use the system DateTime on the AS400? That would be
CURRENT_DATE which you would then have to convert to the number format that
you can compare to your number field.





Reply With Quote
  #8  
Old   
Rick Brandt
 
Posts: n/a

Default Re: AS400 & filter by date - 03-31-2008 , 07:12 PM



Tomas Cerny wrote:
Quote:
Hello,

we need to import data from AS400 to MS SQL 2000 via ODBC driver
(iSeries ODBC by IBM).

The trouble is with date format and using functions such as NOW() or
GETDATE(). Using these function results in errors, because the ODBC
driver doesn't support these commands. But we need to upload data
filtered by actual date. AS400 date field is in fact a number.

So, the task is to compare (or filter in WHERE clause) number (AS400)
with system date (MS SQL)

Thanks for any help,

Tomas
Can you not use the system DateTime on the AS400? That would be
CURRENT_DATE which you would then have to convert to the number format that
you can compare to your number field.





Reply With Quote
  #9  
Old   
Rick Brandt
 
Posts: n/a

Default Re: AS400 & filter by date - 03-31-2008 , 07:12 PM



Tomas Cerny wrote:
Quote:
Hello,

we need to import data from AS400 to MS SQL 2000 via ODBC driver
(iSeries ODBC by IBM).

The trouble is with date format and using functions such as NOW() or
GETDATE(). Using these function results in errors, because the ODBC
driver doesn't support these commands. But we need to upload data
filtered by actual date. AS400 date field is in fact a number.

So, the task is to compare (or filter in WHERE clause) number (AS400)
with system date (MS SQL)

Thanks for any help,

Tomas
Can you not use the system DateTime on the AS400? That would be
CURRENT_DATE which you would then have to convert to the number format that
you can compare to your number field.





Reply With Quote
  #10  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: AS400 & filter by date - 04-01-2008 , 03:19 AM



Hi Tomas,

What is the rule for converting a date to an AS400 number? You should
be able to use the Now() function in an Expression or script task to
generate the SQL command - that way you bypass the ODBC driver
limitations.

Good luck!
J

Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.