## How to convert date from 2014Q3 to 30SEP2014

Solved
Frequent Contributor
Posts: 82

# How to convert date from 2014Q3 to 30SEP2014

I have a date that is coming in from an excel like this:2014Q3.

How to convert this to the last day of the quarter and store in date9. format like 30SEP2014.t

Accepted Solutions
Solution
‎11-04-2014 02:14 PM
Super User
Posts: 8,214

## Re: How to convert date from 2014Q3 to 30SEP2014

Posted in reply to eagles_dare13

Depends upon whether it imported as a SAS date or as a character variable. Here is how to convert either:

data have;

input qtr  yyq6.  charqtr \$;

format qtr cqtr date9.;

qtr=intnx('quarter',qtr,0,'E');

cqtr=intnx('quarter',input(charqtr,yyq6.),0,'E');

cards;

2014Q3 2014Q3

;

All Replies
Solution
‎11-04-2014 02:14 PM
Super User
Posts: 8,214

## Re: How to convert date from 2014Q3 to 30SEP2014

Posted in reply to eagles_dare13

Depends upon whether it imported as a SAS date or as a character variable. Here is how to convert either:

data have;

input qtr  yyq6.  charqtr \$;

format qtr cqtr date9.;

qtr=intnx('quarter',qtr,0,'E');

cqtr=intnx('quarter',input(charqtr,yyq6.),0,'E');

cards;

2014Q3 2014Q3

;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats