Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upload from db2 data into SQL Server 2014

Status
Not open for further replies.
Sep 22, 2013
18
0
0
US
Hello,

I am running the latest version of iSeries (AS/400) I want to do a nightly upload into SQL Server table (2014). My problem is the invDate field is 6 digits (year/month/day):
for the date 160620 is really 06/20/16. How do I get to read only today's date? Below is my code, but I don't know how to code to get for today's date.

Select orderID, invDate, OrderAmt
from OrderDetail
Where invDate = Current(Date)


Any help will be appreciate. Thank you.
 
HI,

Current(Date) is a number: have no idea how that's represented in BD2 but it's probably the number of DAYS or SECONDS, for instance, since some reference date/time. So the date 2016/06/20 is represented as some number like 42541, which is how that date would be represented in a Microsoft application.

160620 is a string of numeric characters.

Do you see the difference?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top