SQL Query to convert two julian date to calender using the table

Suresh p

Active Member
Hello ,
I use Data transfer from system iseries . Throgh sql i downloaded the data. By default the date format is julian date when i download , if i want the date format to calender date one standards table F00365 is there , through this table join we convert the juilan format to calendar format. The issue is if one date field is there , no issue . if more than one date fields is how we write the query to convert the both date field as calendar date format. My query mention below ,kindly help on this issue

SELECT F0311.RPAN8"CUST.NO",F0311.RPALPH"CUST NAME",F0311.RPSDOC"ORDER NO",F0311.RPSDCT"ORDER TY",F58421A.CCLGL1"CUST.PONO",F0311.RPDOC"INVOIC E NO" ,F0311.RPDCT"TYPE",F00365.ONDATE "INVOICE DATE",F0311.RPDDJ"DUE DATE",F0311.RPAG/1000"ORIGINAL AMT",F0311.RPAAP/100 "OPEN AMT"FROM P2DTAA/F0311 LEFT OUTER JOIN F58421A ON F58421A.CCDOCO = F0311.RPSDOC AND F58421A.CCDCTO = F0311.RPSDCT LEFT OUTER JOIN F00365 ON F00365. ONDTEJ = F0311.RPDIVJ WHERE AND (F0311.RPAAP > 0) AND (F0311.RPTRTC <> 'G')

Here i joined the table F0311 & F00365 joined fields are
F00365.ONDTEJ = F0311.RPSDCT and in the selection i put calender fleld is F00365.ONDATE.
The same function i want to use for F0311.RPDDJ also


The tables are used is F0311,F58421A,F00365
Help me
 
Hi,
just now I am off line. But lets check my example:
Select RPDOC, A.ONDATE, B.ONDATE from F0311, F00365 A, F00365 B where RPDGJ = A.ONDGJ and RPVLDT = B.ONDGJ and RPDCO = 1

When you use A and B instead table name then you will be ready join one table multiple times.
Good luck. :)
 
Thanks lot , MY issue was solved and working fine.

Once again thanks lottttttt
 
Back
Top