I have an SQL query like
SELECT
GNTD_SCHEDULE_CODE SCHEDULE,
GNTD_PARENT_ACCT PARENT_ACCOUNT,
GNTD_ACCOUNT_CODE ACCOUNT,
GNTD_COMP_CODE,
SUM(CONVERT(FLOAT, ISNULL(GNTD_CUR_MNTH_ACT, 0))) CURR_MONTH_END,
SUM(CONVERT(FLOAT, ISNULL(GNTD_PRV_PRD_ACT, 0))) PREV_MONTH_END,
SUM(CONVERT(FLOAT, ISNULL(GNTD_CUR_YEA_YTD_ACT, 0))) CURR_YEAR_END,
SUM(CONVERT(FLOAT, ISNULL(GNTD_LST_YEA_YTD_ACT, 0))) PRV_YEAR_END
FROM GLAS_NLMR_PROCESSED_DATA
WHERE GNTD_COMP_CODE = '1'
AND GNTD_ACCT_TYPE = 'P' AND
GNTD_DEP_CODE = isnull ( '01' , GNTD_DEP_CODE)
GROUP BY GNTD_COMP_CODE , GNTD_SCHEDULE_CODE , GNTD_PARENT_ACCT , GNTD_ACCOUNT_CODE
HAVING ( SUM ( isnull ( GNTD_CUR_YEA_YTD_ACT , 0)) <> 0) OR ( SUM ( isnull ( GNTD_CUR_MNTH_ACT , 0)) <> 0)
I am using asp.net crystal report formula editor to conver above query like
{GLAS_NLMR_PROCESSED_DATA.GNTD_COMP_CODE} = {?Company} and
if({?Dept Code})=""
then
{GLAS_NLMR_PROCESSED_DATA.GNTD_DEP_CODE}="01"
else
{GLAS_NLMR_PROCESSED_DATA.GNTD_DEP_CODE} = {?Dept Code} and
I dont know how to use group by and having statement in crystal report.
How can i?