Help using Base SAS procedures

DATE IN sql

Reply
Super Contributor
Posts: 1,041

DATE IN sql

Hello,

 

I have a SQL date '2016-01-31'.

How can i extract month and year together in TSQL,

 

Example: i WANT LIKE BELOW

 

01-2016

 

 

THANKS

Super User
Super User
Posts: 7,942

Re: DATE IN sql

Posted in reply to robertrao

Probably better to ask in a TSQL specific forum.  At a guess I would think cast:

https://docs.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql

Super User
Posts: 5,424

Re: DATE IN sql

Posted in reply to robertrao
Why do want to use TSQL - assuming you have SAS and SAS/ACCESS at your disposal?
Data never sleeps
Ask a Question
Discussion stats
  • 2 replies
  • 122 views
  • 0 likes
  • 3 in conversation