Using Crystal XI r2 going to SQL Server DB.
Need to pull the maximum rate set for each employee and create totals for them so I am using an sql expression. Each employee has multiple records in the rate table.
This expression gives an 'error near Select statement'
Select hbm_persnl.'employee_code' ,
max(tbm_rate_fee.'rate'), hbm_persnl.'employee_name'
From hbm_persnl, tbm_persnl, tbm_rate_fee
where "hbm_persnl"."empl_uno" = "tbm_persnl"."empl_uno"
and "tbm_persnl"."empl_uno" = "tbm_rate_fee"."empl_uno"
Group by employee_code, employee_name
I modified it a little to try to make it work, but this is the sql that works against the database.
Select distinct employee_code 'emplcode',
max(tbm_rate_fee.rate)'ratehigh', hbm_persnl.employee_name'emplname'
From hbm_persnl, tbm_persnl, tbm_rate_fee
where hbm_persnl.empl_uno = tbm_persnl.empl_uno
and tbm_persnl.empl_uno = tbm_rate_fee.empl_uno
Group by employee_code, employee_name
Seems simple enough, any ideas why its not working?
Thanks for all help!!
Need to pull the maximum rate set for each employee and create totals for them so I am using an sql expression. Each employee has multiple records in the rate table.
This expression gives an 'error near Select statement'
Select hbm_persnl.'employee_code' ,
max(tbm_rate_fee.'rate'), hbm_persnl.'employee_name'
From hbm_persnl, tbm_persnl, tbm_rate_fee
where "hbm_persnl"."empl_uno" = "tbm_persnl"."empl_uno"
and "tbm_persnl"."empl_uno" = "tbm_rate_fee"."empl_uno"
Group by employee_code, employee_name
I modified it a little to try to make it work, but this is the sql that works against the database.
Select distinct employee_code 'emplcode',
max(tbm_rate_fee.rate)'ratehigh', hbm_persnl.employee_name'emplname'
From hbm_persnl, tbm_persnl, tbm_rate_fee
where hbm_persnl.empl_uno = tbm_persnl.empl_uno
and tbm_persnl.empl_uno = tbm_rate_fee.empl_uno
Group by employee_code, employee_name
Seems simple enough, any ideas why its not working?
Thanks for all help!!