ItHurtsWhenIThink
Technical User
I'm trying to do a calculation within my select.
strDate=DateAdd("m",-6,date)
SELECT
PPE_Manufacturers.Manufacturer, PPE_Inspection_Elements.Element,
PPE_MFR_Models.Model, PPE_Items.MFR_Serial,
PPE_Items.MONTH_YR_MFR,
PPE_Items.MONTH_YR_MFR + PPE_Inspection_Elements.LifeYrs AS PLife,
Users.LName,
Users.FName,
PPE_Items.DeptID
FROM
PPE_Items INNER JOIN Users ON PPE_Items.UserID = Users.UserID
INNER JOIN PPE_Inspection_Elements INNER JOIN PPE_MFR_Models INNER JOIN
PPE_Manufacturers ON PPE_MFR_Models.MFRID = PPE_Manufacturers.MFRID
ON PPE_Inspection_Elements.ElementID = PPE_MFR_Models.InspElemID
ON PPE_Items.PMIID = PPE_MFR_Models.ModelID
WHERE
PPE_Items.DeptID= '1' AND
PLife < strDate
Problem child is:
PPE_Items.MONTH_YR_MFR + PPE_Inspection_Elements.LifeYrs AS PLife
Just begining my venture into these types of calculations.
This is an ASP project so I cleaned up the statement, so it may not be 100% accurate. I get an invalid column name 'PLife' error
Thanks...
strDate=DateAdd("m",-6,date)
SELECT
PPE_Manufacturers.Manufacturer, PPE_Inspection_Elements.Element,
PPE_MFR_Models.Model, PPE_Items.MFR_Serial,
PPE_Items.MONTH_YR_MFR,
PPE_Items.MONTH_YR_MFR + PPE_Inspection_Elements.LifeYrs AS PLife,
Users.LName,
Users.FName,
PPE_Items.DeptID
FROM
PPE_Items INNER JOIN Users ON PPE_Items.UserID = Users.UserID
INNER JOIN PPE_Inspection_Elements INNER JOIN PPE_MFR_Models INNER JOIN
PPE_Manufacturers ON PPE_MFR_Models.MFRID = PPE_Manufacturers.MFRID
ON PPE_Inspection_Elements.ElementID = PPE_MFR_Models.InspElemID
ON PPE_Items.PMIID = PPE_MFR_Models.ModelID
WHERE
PPE_Items.DeptID= '1' AND
PLife < strDate
Problem child is:
PPE_Items.MONTH_YR_MFR + PPE_Inspection_Elements.LifeYrs AS PLife
Just begining my venture into these types of calculations.
This is an ASP project so I cleaned up the statement, so it may not be 100% accurate. I get an invalid column name 'PLife' error
Thanks...