Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Group Dates

$
0
0

Hi,

I have a date variable 'IG_Date' in the format YYYY-MM-DD

How do I create a new date variable using 'IG_Date' to group up the individual dates into a month and Year format? 

If I format these two dates, I still get 2 record where as I want it totalled up 'Total_amt' into one record. 

2017-01-12   201701   £100

2017-01-18   201701   £257

I want to see:

201701  £357


Viewing all articles
Browse latest Browse all 7129

Trending Articles



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