Skip to content

Tag: sql-server

Trying to get Price Difference and Percent Difference

I am trying to find the daily price difference and the daily percent difference, in one field, in one table. Here is the code that I am testing. Here is a sample of my data (first three fields), with the expected results (last two fields named ‘PriceDiff’ & ‘PercentDiff’). I am usi…

sql Query support required for condition

I have a query if vatgroup chooses x6 or x7 in output has to show ‘-‘ other than than it has to show the value what is come. Based on below query my output comes as * for other than x6 or x7. Thanks Vinoth Answer You are casting your integer sum to varchar(1) which means if the sum is

How to merge rows into one row with separator

I need merge rows into one row for summary of calculation (SQL Server 2014). My SQL query is: Result of this query is: I would like to have this result: When add new currency (x), the result of new currency must be appended: Can somebody please help me with this topic? Many thanks Answer Something like this s…