I am trying to find the sum of values between two dates in this case I would always want to keep one date static. Example finding the value between dates April to July, keeping April static, so therefore another case could be sum of values between dates April to May, again keeping april static. I have been working on several queries for quite sometime but havn’t been sucessful in doing so could you have a look at the following SQLFiddle here and aid me please I would really appreciate the help
Share
Why not just add another
CASEstatement:so your query would be:
see SQL Fiddle with Demo
Then if you want to change the date range, you can pass in a value for the end date and make that a variable.