Crystal Report 8.5
Oracle 9.2.0.7.0
In my table i have a field varchar2(4000) which is een by crystal as memo field. My criteria is based on memo field which i can not see. I tried to create sql expression like {fn SUBSTRING(PERSONCSTMDATA."PERSONCSTMDATATXT", 1, 3)} but it is giving me invalid field error message compiliation error. I tried with oracle odbc driver than crystal report oracle driver but none of them working.
Any help is really appricated at this time. I wrote this Qyery and it is working fine. Can i use this query directly in Crystal report 8.5
/* Pass p_Date Parameter value as of Jan 1 of the year for example, for seeing vaction
balance of dec 31, 2006 and Jan 1 2007 then pass the value as 2007/01/01*/
Select emp.PERSONNUM
,emp.EMPLOYMENTSTATUS
,emp.PAYRULENAME
,emp.PERSONFULLNAME
,emp.PERSONCSTMDATATXT paycode
,acb.PERSONNUM
,acb.ACCRUALCODESHORTNM
,sum(Decode(acb."Type", 1, acb.Balance, '')) "Dec_31"
,sum(Decode(acb."Type", 2, acb.Balance, '')) "Jan_01"
From
(
select ve.PERSONNUM, ve.EMPLOYMENTSTATUS, ve.PAYRULENAME, ve.PERSONFULLNAME, pcd.PERSONCSTMDATATXT
from vp_EMPLOYEEv42 ve, personcstmdata pcd
where ve.PERSONID = pcd.PERSONID
and (pcd.PERSONCSTMDATATXT in ('TA4', 'TA6') or substr(ve.PAYRULENAME, 1, 3) = 'TA6')
and ve.EMPLOYMENTSTATUS = 'Active'
) emp,
(
select va.PERSONFULLNAME
,va.PERSONNUM
,va.ACCRUALCODESHORTNM
,1 "Type"
,sum(va.ACCRUALTRANAMOUNT/3600) Balance
from vp_accrual va
where va.EFFECTIVEDATE >= (select max(act.effectivedate)
from accrualtran act
where act.effectivedate <= _date - 1
and act.ACCRUALCODEID in (514, 516)
and act.TYPE in (3,11)
and act.EMPLOYEEID = va.EMPLOYEEID
)
and va.EFFECTIVEDATE <= _date - 1
and
va.ACCRUALCODESHORTNM in ('VAC', 'VTC')
group by
va.PERSONFULLNAME
,va.PERSONNUM
,va.ACCRUALCODESHORTNM
UNION
select va.PERSONFULLNAME
,va.PERSONNUM
,va.ACCRUALCODESHORTNM
,2 "Type"
,sum(va.ACCRUALTRANAMOUNT/3600) Balance
from vp_accrual va
where va.EFFECTIVEDATE >= (select max(act.effectivedate)
from accrualtran act
where act.effectivedate <= _date
and act.ACCRUALCODEID in (514, 516)
and act.TYPE in (3,11)
and act.EMPLOYEEID = va.EMPLOYEEID
)
and va.EFFECTIVEDATE <= _date
and
va.ACCRUALCODESHORTNM in ('VAC', 'VTC')
group by
va.PERSONFULLNAME
,va.PERSONNUM
,va.ACCRUALCODESHORTNM
) acb
Where emp.PERSONNUM = acb.PERSONNUM(+)
group by
emp.PERSONNUM
,emp.EMPLOYMENTSTATUS
,emp.PAYRULENAME
,emp.PERSONFULLNAME
,emp.PERSONCSTMDATATXT
,acb.PERSONNUM
,acb.ACCRUALCODESHORTNM
Oracle 9.2.0.7.0
In my table i have a field varchar2(4000) which is een by crystal as memo field. My criteria is based on memo field which i can not see. I tried to create sql expression like {fn SUBSTRING(PERSONCSTMDATA."PERSONCSTMDATATXT", 1, 3)} but it is giving me invalid field error message compiliation error. I tried with oracle odbc driver than crystal report oracle driver but none of them working.
Any help is really appricated at this time. I wrote this Qyery and it is working fine. Can i use this query directly in Crystal report 8.5
/* Pass p_Date Parameter value as of Jan 1 of the year for example, for seeing vaction
balance of dec 31, 2006 and Jan 1 2007 then pass the value as 2007/01/01*/
Select emp.PERSONNUM
,emp.EMPLOYMENTSTATUS
,emp.PAYRULENAME
,emp.PERSONFULLNAME
,emp.PERSONCSTMDATATXT paycode
,acb.PERSONNUM
,acb.ACCRUALCODESHORTNM
,sum(Decode(acb."Type", 1, acb.Balance, '')) "Dec_31"
,sum(Decode(acb."Type", 2, acb.Balance, '')) "Jan_01"
From
(
select ve.PERSONNUM, ve.EMPLOYMENTSTATUS, ve.PAYRULENAME, ve.PERSONFULLNAME, pcd.PERSONCSTMDATATXT
from vp_EMPLOYEEv42 ve, personcstmdata pcd
where ve.PERSONID = pcd.PERSONID
and (pcd.PERSONCSTMDATATXT in ('TA4', 'TA6') or substr(ve.PAYRULENAME, 1, 3) = 'TA6')
and ve.EMPLOYMENTSTATUS = 'Active'
) emp,
(
select va.PERSONFULLNAME
,va.PERSONNUM
,va.ACCRUALCODESHORTNM
,1 "Type"
,sum(va.ACCRUALTRANAMOUNT/3600) Balance
from vp_accrual va
where va.EFFECTIVEDATE >= (select max(act.effectivedate)
from accrualtran act
where act.effectivedate <= _date - 1
and act.ACCRUALCODEID in (514, 516)
and act.TYPE in (3,11)
and act.EMPLOYEEID = va.EMPLOYEEID
)
and va.EFFECTIVEDATE <= _date - 1
and
va.ACCRUALCODESHORTNM in ('VAC', 'VTC')
group by
va.PERSONFULLNAME
,va.PERSONNUM
,va.ACCRUALCODESHORTNM
UNION
select va.PERSONFULLNAME
,va.PERSONNUM
,va.ACCRUALCODESHORTNM
,2 "Type"
,sum(va.ACCRUALTRANAMOUNT/3600) Balance
from vp_accrual va
where va.EFFECTIVEDATE >= (select max(act.effectivedate)
from accrualtran act
where act.effectivedate <= _date
and act.ACCRUALCODEID in (514, 516)
and act.TYPE in (3,11)
and act.EMPLOYEEID = va.EMPLOYEEID
)
and va.EFFECTIVEDATE <= _date
and
va.ACCRUALCODESHORTNM in ('VAC', 'VTC')
group by
va.PERSONFULLNAME
,va.PERSONNUM
,va.ACCRUALCODESHORTNM
) acb
Where emp.PERSONNUM = acb.PERSONNUM(+)
group by
emp.PERSONNUM
,emp.EMPLOYMENTSTATUS
,emp.PAYRULENAME
,emp.PERSONFULLNAME
,emp.PERSONCSTMDATATXT
,acb.PERSONNUM
,acb.ACCRUALCODESHORTNM