Question

what is wrong with this query? I do have column called percet with tinyint. please help

SELECT LC.ID , LC.DESCRIPTION , LC.CHANGEDBYID , LP.PERCENT , LP.ADDEDBYID , LP.DATEADDED FROM LIKELIHOODTYPECODE LC JOIN LIKELIHOODPERCENT LP ON LC.ID = LP.ID;

If I do Select * from likelihoodpercent then it will show all my column with percent, but when I do select percent from likelihoodpercent then it give me error.

Thanks

Was it helpful?

Solution

PERCENT is a SQL Server keyword. To use it in a query, put square brackets around it:

SELECT LC.ID , LC.DESCRIPTION , LC.CHANGEDBYID , LP.[PERCENT] , LP.ADDEDBYID , LP.DATEADDED FROM LIKELIHOODTYPECODE LC JOIN LIKELIHOODPERCENT LP ON LC.ID = LP.ID;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top