Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- Department
- , [Transaction Type]
- , Quantity
- , [Date/Time]
- , CASE
- when (cast([Date/Time] as Date) >= '2014-06-01' and cast([Date/Time] as Date) < '2014-07-01') then 'June'
- when (cast([Date/Time] as Date) >= '2014-07-01' and cast([Date/Time] as Date) < '2014-08-01') then 'July'
- when (cast([Date/Time] as Date) >= '2014-08-01' and cast([Date/Time] as Date) < '2014-09-01') then 'Aug'
- when (cast([Date/Time] as Date) >= '2014-09-01' and cast([Date/Time] as Date) < '2014-10-01') then 'Sept'
- when (cast([Date/Time] as Date) >= '2014-10-01' and cast([Date/Time] as Date) < '2014-11-01') then 'Oct'
- when (cast([Date/Time] as Date) >= '2014-11-01' and cast([Date/Time] as Date) < '2014-12-01') then 'Nov'
- when (cast([Date/Time] as Date) >= '2014-12-01' and cast([Date/Time] as Date) < '2015-01-01') then 'Dec'
- else ''
- END as Months
- FROM [dbo].[DETAIL_DATA]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement