Last post Sep 27, 2012 12:19 AM by prabu.raveendran
Sep 26, 2012 11:18 PM|karenbalmaceda|LINK
Hi. I am using VS 2010 and SQL Server 2008. Now when I generate one of my reports in Crystal report, my data which is for example, 1.5 shows up as 1 only in crystal report. The column's datat type where the data is VARCHAR and I cast it as Decimal on the
stored procedure. I've also tried to cast it as FLOAT and REAL. But it still shows up as 1 instead of 1.5.
Anyone who knows the solution? thanks.
Sep 27, 2012 12:04 AM|prabu.raveendran|LINK
Post your stored procedure which done the the conversion part
Sep 27, 2012 12:11 AM|karenbalmaceda|LINK
Emp.FirstName + ' ' + Emp.LastName AS EmployeeName,
CAST (Cmg.OverallPARating AS DECIMAL(18,2)), //This is the part where I am converting.
YEAR (GETDATE()) - CAST (SUBSTRING(emp.CurrentPositionDate, 4, 4) AS INT)AS IncumbentYearsInCurrentPosition ,
YEAR (GETDATE()) - CAST (SUBSTRING(emp.DateJoined, 4, 4) AS INT) AS IncumbentYearsInService,
CAST(CAST(Cmg.MonthlySalary AS DECIMAL(18,2)) AS DECIMAL(18, 2)) AS IncumbentCompensation,
CAST(CAST (Rep.ReplacementCompensation AS DECIMAL(18,2)) AS DECIMAL(18,2)) AS ReplacementCompensation,
(SELECT TOP (1)YEAR (GETDATE()) - CAST (SUBSTRING(emp.DateJoined, 4, 4) AS INT) FROM Employees Emp WHERE Rep.ReplacementEmployeeID=Emp.EmployeeID) AS ReplacementYrsInService
FROM Employees Emp
LEFT JOIN ColorMeGreens Cmg
ON Cmg.EmployeeID = Emp.EmployeeID
LEFT JOIN Positions Pos
ON Pos.PositionID = Emp.PositionID
LEFT JOIN Replacements Rep
ON Rep.EmployeeID = emp.EmployeeID
Cmg.YearOfUpdate BETWEEN @FiscalYrFROM AND @FiscalYrTO
AND Emp.EmployeeNumber = @EmployeeNumber
ORDER BY Emp.EmployeeID
Sep 27, 2012 12:19 AM|prabu.raveendran|LINK
Your stored procedure seems to be ok.
Check the datatype of the field which is used to design the crystal report. If it is varchar you have to change that into decimal and then try.