Hi, I'm trying to do a subselect in SQL on an AS400 and getting a "Data conversion or data mapping error" - I'm pretty sure its to do with the way SQL is handling dates in the subselect (specifically it's changing the format by adding commas into a decimal field and it's getting confused when it does the next select) - could someone confirm this for me?? maybe suggest how I need to get round this problem??
Basically, I have something like below, with dates as decimal and in this format: CCYYMMDD (ie if you just do a select on the dates they come out as CC,YYM,MDD). The date is coming from table3
SELECT *
FROM TABLE1 A
CROSS JOIN TABLE2 B
LEFT OUTER JOIN (SELECT *
FROM TABLE3 C
LEFT OUTER JOIN TABLE4 D ON (blah)
INNER JOIN TABLE5 E ON (blah)
WHERE DATE >= 20080101
AND DATE <= 20090101
) AS C ON (blah AND blah)