Since everyone should be in a SQL Join state of mind...here's another one.

I have a weird issue that I haven't been able to narrow down yet. I'm trying to 
add a new field to one of my tables to store some additional information, but 
once I add the column, my previously working query breaks.

Here's the query (obviously the person that originally wrote it is in the 'the 
fewer characters, the better' camp):

SELECT p.*, pt.*, pm.Type AS mtype, s.fname AS sfname, s.lname AS slname, 
pa.DateActive AS PenAmountDate, pa.MonthlyAmount AS PenAmt, pa.Note AS 
PenAmtNote, s.SSN AS sssn, s.DOB AS sdob, spm.Type AS smt

FROM   PensionerMedicalType spm
INNER JOIN PensionerSpouse s ON spm.MedicalID = s.MedicalType 
RIGHT OUTER JOIN PensionersActive p 
INNER JOIN PensionerType pt ON p.PensionerType = pt.PensionerTID 
LEFT OUTER JOIN PensionAmounts pa ON p.PenActID = pa.PenID 
LEFT OUTER JOIN PensionerMedicalType pm ON p.MedicalType = pm.MedicalID ON 
s.SpouseID = p.Spouse
WHERE  (p.PenActID = <cfqueryparam cfsqltype="cf_sql_integer" value="#id#"> AND 
pa.active = 1)                  


As soon as I add a column named 'lifeInsType' to the PensionersActive (p) 
table, I get the following error when the same query runs:

Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver]Value can not be converted to requested type.

What am I overlooking? 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341801
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to