Dear statlist,
Please find the data hereafter
I have a list of companies with different dates and I like to change the format from MDY to DMY;
When I use the following code :
gen new_date=date( Date , "DMY")
I have the following error :
type mismatch
r(109),
So i try to put the data in string (since it's numeric) with the following code:
. decode Date, gen DATE
But i have the error here :
Date not labeled
r(182);
When I use the following code
la variable Date Date
It doesn't work, the variable seem to be labelled but I still cant encode the variable
I think I don't manage to label my variable.
My final purpose is to have the variable date in format DD/MM/YYYY
Here is the data I am using:
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input int(NOMBRE Company Date) double PRICE str58 Name str12 ISIN
1 1 17304 15.8 "MICROPOLE - PRICE INDEX" "FR0000077570"
2 1 17307 15.2 "MICROPOLE - PRICE INDEX" "FR0000077570"
3 1 17308 15.2 "MICROPOLE - PRICE INDEX" "FR0000077570"
4 1 17309 15.1 "MICROPOLE - PRICE INDEX" "FR0000077570"
5 1 17310 15.1 "MICROPOLE - PRICE INDEX" "FR0000077570"
6 1 17311 15.1 "MICROPOLE - PRICE INDEX" "FR0000077570"
7 1 17314 15.1 "MICROPOLE - PRICE INDEX" "FR0000077570"
8 1 17315 15.4 "MICROPOLE - PRICE INDEX" "FR0000077570"
9 1 17316 15.4 "MICROPOLE - PRICE INDEX" "FR0000077570"
10 1 17317 15.2 "MICROPOLE - PRICE INDEX" "FR0000077570"
11 1 17318 14.8 "MICROPOLE - PRICE INDEX" "FR0000077570"
12 1 17321 15 "MICROPOLE - PRICE INDEX" "FR0000077570"
--more--
Thanks a lot for your answer,
Best regards
Please find the data hereafter
I have a list of companies with different dates and I like to change the format from MDY to DMY;
When I use the following code :
gen new_date=date( Date , "DMY")
I have the following error :
type mismatch
r(109),
So i try to put the data in string (since it's numeric) with the following code:
. decode Date, gen DATE
But i have the error here :
Date not labeled
r(182);
When I use the following code
la variable Date Date
It doesn't work, the variable seem to be labelled but I still cant encode the variable
I think I don't manage to label my variable.
My final purpose is to have the variable date in format DD/MM/YYYY
Here is the data I am using:
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input int(NOMBRE Company Date) double PRICE str58 Name str12 ISIN
1 1 17304 15.8 "MICROPOLE - PRICE INDEX" "FR0000077570"
2 1 17307 15.2 "MICROPOLE - PRICE INDEX" "FR0000077570"
3 1 17308 15.2 "MICROPOLE - PRICE INDEX" "FR0000077570"
4 1 17309 15.1 "MICROPOLE - PRICE INDEX" "FR0000077570"
5 1 17310 15.1 "MICROPOLE - PRICE INDEX" "FR0000077570"
6 1 17311 15.1 "MICROPOLE - PRICE INDEX" "FR0000077570"
7 1 17314 15.1 "MICROPOLE - PRICE INDEX" "FR0000077570"
8 1 17315 15.4 "MICROPOLE - PRICE INDEX" "FR0000077570"
9 1 17316 15.4 "MICROPOLE - PRICE INDEX" "FR0000077570"
10 1 17317 15.2 "MICROPOLE - PRICE INDEX" "FR0000077570"
11 1 17318 14.8 "MICROPOLE - PRICE INDEX" "FR0000077570"
12 1 17321 15 "MICROPOLE - PRICE INDEX" "FR0000077570"
--more--
Thanks a lot for your answer,
Best regards
Comment