Hi,
I want to add field in cursor like the following:
myr = '2011'
myr1 = '2012'
myr1 = '2013'
myr1 = '2014'
myr1 = '2015'
myr1 = '2016'
SELECT YEAR(invdate) as theyear,;
location As location, ;
sum(qntymaj) As cartons, ;
sum(qntymin) As units, ;
sum(Iif(ratemin#0,qntymin*ratemin,qntymaj*ratemaj)) As mamount ;
from SalQuery ;
group By theyear,location ;
INTO CURSOR tempsi READWRITE
ALTER table tempsi ADD COLUMN &mYr n(13,2)
ALTER table tempsi ADD COLUMN &mYr1 n(13,2)
ALTER table tempsi ADD COLUMN &mYr2 n(13,2)
ALTER table tempsi ADD COLUMN &mYr3 n(13,2)
ALTER table tempsi ADD COLUMN &mYr4 n(13,2)
ALTER table tempsi ADD COLUMN &mYr5 n(13,2)
I want to general the header like 2011,2012,2013,2014,2015,2016 instead of myr,myr1,myr2,myr3,myr4,myr5,myr6.
It gives syntax error. Please let me know what is wrong in this?
Thanks
Saif
I want to add field in cursor like the following:
myr = '2011'
myr1 = '2012'
myr1 = '2013'
myr1 = '2014'
myr1 = '2015'
myr1 = '2016'
SELECT YEAR(invdate) as theyear,;
location As location, ;
sum(qntymaj) As cartons, ;
sum(qntymin) As units, ;
sum(Iif(ratemin#0,qntymin*ratemin,qntymaj*ratemaj)) As mamount ;
from SalQuery ;
group By theyear,location ;
INTO CURSOR tempsi READWRITE
ALTER table tempsi ADD COLUMN &mYr n(13,2)
ALTER table tempsi ADD COLUMN &mYr1 n(13,2)
ALTER table tempsi ADD COLUMN &mYr2 n(13,2)
ALTER table tempsi ADD COLUMN &mYr3 n(13,2)
ALTER table tempsi ADD COLUMN &mYr4 n(13,2)
ALTER table tempsi ADD COLUMN &mYr5 n(13,2)
I want to general the header like 2011,2012,2013,2014,2015,2016 instead of myr,myr1,myr2,myr3,myr4,myr5,myr6.
It gives syntax error. Please let me know what is wrong in this?
Thanks
Saif