服务费查询.sql 1.1 KB

12345678910111213141516
  1. /****** Script for SelectTopNRows command from SSMS ******/
  2. SELECT [开单人]
  3. ,[id] '订单号'
  4. ,[date] '收款日期'
  5. ,[money] '金额'
  6. ,[bz] '收款项目名称'
  7. ,[ren] '收款人'
  8. ,[paytype] '支付方式'
  9. ,[name1] '老板姓名'
  10. ,[name2] '影楼名称'
  11. ,[txtype] '套系类型'
  12. ,[taoxiname] '版本类型'
  13. FROM [Internal].[dbo].[dindanbukuanview##] where bz like '%服务费%' and [date] like '2014%' order by [开单人]
  14. SELECT [开单人],sum(convert(int,[money],10)) '金额'
  15. FROM [Internal].[dbo].[dindanbukuanview##] where bz like '%服务费%' and [date] like '2014%' group by [开单人]