Hello,
I am trying to create a view, if I run my sql statement it runs fine, no issues but if I add the create view I get a -104 error
my sql statement looks like this
not sure why it would not let me do a create view
I am trying to create a view, if I run my sql statement it runs fine, no issues but if I add the create view I get a -104 error
my sql statement looks like this
not sure why it would not let me do a create view
Code:
SELECT
B.CDAGQ7, A.C6AAYG, D.CJAKDT, D.CJAJDT, A.C6DCCD, A.C6IDST,
D.CJAIDT, E.SLSNO, C6CVNB AS "ORDER", CJCBTX AS PO, A.C6CANB,
DEHITX AS CUSTUMER, CDAITX AS ITEM,
SUBSTR(VARCHAR(CDAITX),1,6) AS PARTNUM, B.CDHJTX, (CDACQT),
B.CDKHVA, ((B.CDKHVA*CDACQT)), A.C6DBVA, I.ALBYCD, A.C6ALDT,
A.C6ACDT, A.C6D0NB, SUBSTR(DIGITS(A.C6ACDT),4,2) AS ORDMO,
SUBSTR(DIGITS(A.C6ACDT),6,2) AS ORDDAY,
SUBSTR(DIGITS(A.C6ACDT),2,2) AS ORDYR,
SUBSTR(DIGITS(A.C6ACDT),4,2) AS MANUFMO,
SUBSTR(DIGITS(A.C6ACDT),6,2) AS MANUFDAY,
SUBSTR(DIGITS(A.C6ACDT),2,2) AS MANUFYR,
SUBSTR(DIGITS(A.C6ALDT),4,2) AS CREATEMO,
SUBSTR(DIGITS(A.C6ALDT),6,2) AS CREATEDAY,
SUBSTR(DIGITS(A.C6ALDT),2,2) AS CREATEYR, C6ACDT AS "DATE", G.GYMD,
H.GYMD, G.GREG, H.GREG, SUBSTR(DIGITS(D.CJAKDT),6,2) AS MANUFORDDY,
SUBSTR(DIGITS(D.CJAKDT),4,2) AS MANUFORDMT,
SUBSTR(DIGITS(D.CJAKDT),2,2) AS MANUFORDYR, J.ADBIDT,
((C6DCVA-C6DBVA)/C6DCVA)*100 AS MRGN
FROM AMFLIB2.MBC6REP A CROSS JOIN
AMFLIB2.MBCDREP B CROSS JOIN
AMFLIB2.MBDEREP C CROSS JOIN
AMFLIB2.MBCJCPP D CROSS JOIN
AMFLIB2.CUSMAS E CROSS JOIN
mydbfile.SLSCOMM F CROSS JOIN
mydbfile.CALENDAR G CROSS JOIN
mydbfile.CALENDAR H CROSS JOIN
AMFLIB2.MBALREP I CROSS JOIN
AMFLIB2.MBADREP J
WHERE C6DCCD = CDDCCD
AND C6CVNB = CDCVNB
AND C6CANB = DECANB
AND C6B9CD = DEB9CD
AND C6DCCD = CJDCCD
AND C6CVNB = CJCVNB
AND A.C6CANB = E.CUSNO
AND E.SLSNO = F.SLSNO
AND A.C6ACDT = G.GYMD
AND D.CJAKDT = H.GYMD
AND C.DECANB = I.ALCANB
AND C.DECUCD = I.ALCUCD
AND CDDCCD = ADDCCD
AND CDCVNB = ADCVNB
AND CDAENB = ADAENB
AND CDFCNB = ADFCNB
AND CDAITX = ADAITX
AND (A.C6DCCD = '1'
AND B.CDAGQ7 = 1)
ORDER BY 009 ASC