Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. SELECT
  2. Department
  3. , [Transaction Type]
  4. , Quantity
  5. , [Date/Time]
  6. , CASE
  7. when (cast([Date/Time] as Date) >= '2014-06-01' and cast([Date/Time] as Date) < '2014-07-01') then 'June'
  8. when (cast([Date/Time] as Date) >= '2014-07-01' and cast([Date/Time] as Date) < '2014-08-01') then 'July'
  9. when (cast([Date/Time] as Date) >= '2014-08-01' and cast([Date/Time] as Date) < '2014-09-01') then 'Aug'
  10. when (cast([Date/Time] as Date) >= '2014-09-01' and cast([Date/Time] as Date) < '2014-10-01') then 'Sept'
  11. when (cast([Date/Time] as Date) >= '2014-10-01' and cast([Date/Time] as Date) < '2014-11-01') then 'Oct'
  12. when (cast([Date/Time] as Date) >= '2014-11-01' and cast([Date/Time] as Date) < '2014-12-01') then 'Nov'
  13. when (cast([Date/Time] as Date) >= '2014-12-01' and cast([Date/Time] as Date) < '2015-01-01') then 'Dec'
  14. else ''
  15. END as Months
  16. FROM [dbo].[DETAIL_DATA]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement