September 12, 2008 at 10:47 am
I have a staging table that I am using to do my calculation into the final table.
In my staging table I have all the necessary columns to do the calculations. But I am having trouble do so. Can anyone help me solve this problem.
Here is my query...again, all of my calculation will be done from columns of the summary table.
SELECT
lease_new_days_count
,lease_new_vacancy_days
,lease_original_vacancy_days
,lease_new_amount
,lease_original_amount
,lease_new_move_cost
,thc_new_lease
,thc_original_lease
, (((thc_new_lease - thc_original_lease / 30.5) * lease_new_vacancy_days)
+ (((lease_new_amount - lease_original_amount ) / 30.5)
* (lease_new_days_count - lease_new_vacancy_days))
,((thc_new_lease / 30.5 ) * (lease_new_vacancy_days )) total_vacancy_amount_new
FROM dbo.summary
--the error that I get
Msg 102, Level 15, State 1, Line 16
Incorrect syntax near ','.
September 12, 2008 at 11:34 am
Your parenthesis don't match, You have an extra open one, and you need to either remove it or determine where you're missing the closing one.
September 12, 2008 at 11:38 am
Try
((lease_new_amount - lease_original_amount ) / 30.5)
you have 7 opening and 6 closings in it.
SQL DBA.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy