was idd die max() vergetenhmm, en dit:
select Name, Date, Cat, Amount
from tabel A
where Name || VARCHAR_FORMAT( TIMESTAMP(Date) ,'YYYYMMDD') in
(select Name || VARCHAR_FORMAT( TIMESTAMP(max(Date)) ,'YYYYMMDD')
from tabel B
GROUP BY Name
);
(Je hebt ook de max() laten vallen.)
Ik geraak al iets verder als ik er
Code:
select Name, Date, Cat, Amount
from TABLE A
where Name || VARCHAR_FORMAT(TIMESTAMP(A.Date,'YYYYMMDD')) in
(select Name || VARCHAR_FORMAT ( TIMESTAMP (MAX(Date)) ,'YYYYMMDD')
from TABLE B
GROUP BY Name
);
Message: [SQL0171] Argument 1 of function TIMESTAMP not valid. Cause . . . . . : The data type, length, or value of argument 1 of function TIMESTAMP specified is not valid. Recovery . . . : Refer to the DB2 for IBM i SQL Reference topic collection in the Database category in the IBM i Information Center for more information on scalar functions. Correct the arguments specified for the function. Try the request again. Processing ended because the highlighted statement did not complete successfully
Als ik die 2e DATE vervang door A.Date , B.Date of de oorspronkelijke databasenaam.Date vervang, blijft hetzelfde issue.