April 11, 2014 at 3:19 am
Hi,
I have this query where I do certain conversions and on top of this how can I sum the column values.
'$ '+ Replace(CONVERT(varchar,CAST(Total__Amount AS money),1) ,'.00','') as Total_Amount,
'$ '+ Replace(CONVERT(varchar,CAST(Monthly_Amount As money),1),'.00','') as Monthly_Amount,
Now on top of this query how can I sum the columns.
April 11, 2014 at 3:31 am
Could you post some sample data and your expected results please? It will make it a lot easier to answer your questions.
How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537
April 11, 2014 at 3:38 am
Updated my post and pls take a look.
April 11, 2014 at 3:59 am
We've still got a lot of guesswork to do to help out, and that's what we're here to do. If you read this article and post some samples like it suggests, it will be a lot easier to see what you want us to do.
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you're worried about hiding business practices, change the table and column names to something that hides them but still gives an idea what they do. I work for an organisation with quite a lot to hide (in many ways...) so I went for a pirate theme [/url] when I had a tricky question to post. You don't need to post the full query either. I just posted the edited highlights, it gave an idea of what needed to be done but cut out lines of code and hid everything I wanted to hide.
How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply