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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting date from AS400 query to MS Access

Status
Not open for further replies.

rjd2003

MIS
Jul 29, 2003
15
NL
Hello from Holland!

I try to convert a date from AS400 query to MS Access through an ODBC.

Fields are as follows: LKINGD (day) LKINGM (month) and LKINGJ (year).

The desired result is: dd/mm/yy or dd-mm-yy.

I use the following formula in AS400 query:

date(digits(LKINGD)||'/'||digits(LKINGM)||'/'||digits(LKINGJ))

Running the query does not work.

How come?

By using the following formula:

digits(LKINGD)||digits(LKINGM)||digits(LKINGJ)

I succeed in transferring to MS Acces but the outcome is kind of strange: "F0F1F1" instead of "011190" that I expected.

Who can help me??

Thanks in advance,

Robert
 
My experience with AS400 date format is that it is in CCYYMMDD format ...."20030701"

IE: in MSAccess
=Format(Year(Date()),"0000") & Format(Month(Date()),"00") & Format(Day(Date()),"00")

in MSExcel
=text(year(now()),"0000")&text(month(now()),"00")&text(day(now()),"00")
 
My problem is that there are 3 fields. I am now trying to make subqueries in AS400 to get rid of "zero" fields.
 
my_date:=[LKINGD] & "/" & [LKINGM]& "/" & [LKINGJ]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top