June 6, 2014 at 9:46 am
Hi there ...
I have two columns vital_bp_diastolic & systolic and the formula to calculate the MAP is [(2 * column) + column]/3 in SQL
i tried but i am getting the invalid column name error
can anyone help
June 6, 2014 at 10:07 am
Could you post the whole query and the exact error you get?
Even better would be to have DDL (table definition) and sample data.
June 6, 2014 at 10:34 am
fawad.majid (6/6/2014)
Hi there ...I have two columns vital_bp_diastolic & systolic and the formula to calculate the MAP is [(2 * column) + column]/3 in SQL
i tried but i am getting the invalid column name error
can anyone help
Are you trying to include those square brackets in your calculation? If so, you are telling sql that the name of your column is (2 * column) + column.
I don't think this is your actual column name.
declare @table table ([(2 * column) + column] int)
insert @table select 50
select * from @table
Try changing those to ( and ). Like this. ((2 * column) + column)/3
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply