UPDATE [dbo].[REF_SQLFIELDS] SET [Code]=N'CASE WHEN [ContractFTE] > 0 THEN
	CAST(CASE ISNULL((SELECT Code FROM LKP_COMBO_VALUES WHERE Ndx = CAST(pg.Min_Pay_Basis as int)), ''A'')
	WHEN ''A'' THEN [Calc_Pay_Annual]
	WHEN ''M'' THEN [Calc_Pay_Monthly]
	WHEN ''W'' THEN [Calc_Pay_Weekly]
	WHEN ''D'' THEN [Calc_Pay_Daily]
	WHEN ''H'' THEN [Calc_Pay_Hourly]
	END as money) / [ContractFTE]
ELSE 0 END{{J}}[#J#CheckWithinGradeLimit]' WHERE [Table_Name] = N'DT_PAY' AND [Field_Name] = N'FTEPay' AND [CustomisationID] = 0
