Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
divan
Posting Yak Master
153 Posts |
Posted - 2013-05-23 : 09:24:40
|
I have written the following scriptSELECT SUM (F.AMOUNT) AS AMOUNT, C.PRINT_TIME AS YEARFROM CLAIM_FNCL_TRANS FINNER JOIN CHECKS C ON F.INSTRUMENT_KEY = C.PHNX_GUIDWHERE F.ACCOUNT_CD = 'E' AND F.TRANS_TYPE_CD = 'E' GROUP BY C.PRINT_TIMEwhich works perfectly and I get the following result11385.32 2011-02-16 08:50:47.470354.83 2013-05-21 18:00:46.8031044.75 2013-05-21 18:01:58.0903580.77 2013-05-21 18:01:20.1136265.22 2009-03-11 09:12:31.1505355.00 2013-05-21 18:01:29.670what I really need to see is the amount just by year. example6265.22 200911385.32 201110295.35 2013 |
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2013-05-23 : 09:26:32
|
Replace C.PRINT_TIME with Year(C.PRINT_TIME) in select and group by clauseCheersMIK |
 |
|
shettybhas
Starting Member
3 Posts |
Posted - 2013-05-23 : 09:51:16
|
In column list also replace it YEAR(c.Print_Time) |
 |
|
divan
Posting Yak Master
153 Posts |
Posted - 2013-05-23 : 14:46:41
|
Thanks this worked... |
 |
|
|
|
|