Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

sum and datediff, help me please I'm frustrated!!!

$
0
0
  1. Create separate select queries to aggregate the SUM of amount field from the

dbo.[NAV_dbo_Service Line_V] table using the DATEDIFF function

I have to do it in a month to date and year to date separately (that's not the problem once I figure out how to do one I can do the other one) This is what I got so far and of course it shows an error

select

SUM((amount)datediff(YEAR, 1,getdate())from dbo.[NAV_dbo_Service Line_V]

Any help would be very very appreciated

Thank you so much


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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