Hey all,
I have this query which at my knowledge should run pretty smoothly:
S.Section is a float type column and when I run the query it doesn't show me any results when I know that 2.1 should return a phone number. In fact it doesn't run with any float values. S.Section contains both integers and float type values (1 ; 1.1 ; 1.2; 2; 2.1; 2.2 etc...) Basically it stores sections along with sub section. Thing is, it runs smoothly when I put in 2 instead of 2.1 or any integer values for that matter.Code:SELECT E.PhoneNumber FROM itrdemployees E INNER JOIN itrdtrpt T ON E.EmpNumber = T.EmpNumber INNER JOIN itrdinquirysections S ON T.TransferPoint = S.EngTransPoint WHERE S.Section = 2.1 AND T.ActiveContact = 1
doesn't work:
works:Code:WHERE S.Section = 2.1 AND T.ActiveContact = 1
Is there some sort of cast I must do around the value before running the query? Say: ...WHERE (float)2.1 AND...Code:WHERE S.Section = 2 AND T.ActiveContact = 1
ps: I know that it should return data with the float values, I have checked with the current data in the database.
Any pointers would be greatly appreciated. Thanks.


Reply With Quote

Bookmarks