Quantcast
Channel: SQL Server Reporting Services, Power View Forum
Viewing all articles
Browse latest Browse all 4035

Modification in SQL Query Needed

$
0
0

Hi All,

I am using SQL server 2008 R2. Please help me out. Any help is appreciated.

I have 2 parameters: Month and Year.

This is my column values for month of April and May.

Month

Bid Value

Days

4

1000

30

5

2000

31

When I write the Query as:

Select Month, sum (Bid Value/Days) as Value from Table Name where (Month between 4 and 5) group by Month

I am not getting the desired results as,

Month

Value

4

33.33

5

64.51

But I am getting as,

Month

Value

4

33.33 (1000/30)

4

32.25 (1000/31)

5

66.66 (2000/30)

5

64.51 (2000/31)

Month(Final O/P is coming like this)

Value

4

65.58

5

131.17


Thanks in advance, Akhila Vasishta


Viewing all articles
Browse latest Browse all 4035

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>