Day of week conversion from edate

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Day of week conversion from edate

John F Hall
I need to generate a "day of week" variable with values "Sunday" thru "Saturday" from data in the following format.   
 
26.04.2010
26.04.2010
26.04.2010
26.04.2010
01.05.2010
 
This could be numeric with 1 thru 7 or a string with actual day names.  If it's easier, I already have a date-time variable in this format:
 
26-Apr-2010 12:51
26-Apr-2010 22:01
26-Apr-2010 22:01
26-Apr-2010 22:01
1-May-2010 15:48
 
Can anyone help?
 
TIA
 
John Hall
Reply | Threaded
Open this post in threaded view
|

Re: Day of week conversion from edate

Rick Oliver-3

xdate.wkday


From: John F Hall <[hidden email]>
To: [hidden email]
Date: 07/01/2010 11:44 AM
Subject: Day of week conversion from edate
Sent by: "SPSSX(r) Discussion" <[hidden email]>





I need to generate a "day of week" variable with values "Sunday" thru "Saturday" from data in the following format.    
 
26.04.2010
26.04.2010
26.04.2010
26.04.2010
01.05.2010

 
This could be numeric with 1 thru 7 or a string with actual day names.  If it's easier, I already have a date-time variable in this format:
 
26-Apr-2010 12:51
26-Apr-2010 22:01
26-Apr-2010 22:01
26-Apr-2010 22:01
1-May-2010 15:48

 
Can anyone help?
 
TIA
 
John Hall

Reply | Threaded
Open this post in threaded view
|

Re: Day of week conversion from edate

John F Hall
Rick
 
Thanks for this.  Saved me a lot of time after all day working on a different data set.  Had to think about your reply, but assumed (correctly) that it was a function.  It's given a numeric code, so all I have to do now is add labels.  Only second time I've used dates: some useful stuff on page 101 and 102 of the reference manual.
 
John Hall
----- Original Message -----
Sent: Thursday, July 01, 2010 6:48 PM
Subject: Re: Day of week conversion from edate


xdate.wkday


From: John F Hall <[hidden email]>
To: [hidden email]
Date: 07/01/2010 11:44 AM
Subject: Day of week conversion from edate
Sent by: "SPSSX(r) Discussion" <[hidden email]>





I need to generate a "day of week" variable with values "Sunday" thru "Saturday" from data in the following format.    
 
26.04.2010
26.04.2010
26.04.2010
26.04.2010
01.05.2010

 
This could be numeric with 1 thru 7 or a string with actual day names.  If it's easier, I already have a date-time variable in this format:
 
26-Apr-2010 12:51
26-Apr-2010 22:01
26-Apr-2010 22:01
26-Apr-2010 22:01
1-May-2010 15:48

 
Can anyone help?
 
TIA
 
John Hall

Reply | Threaded
Open this post in threaded view
|

Re: Day of week conversion from edate

Rick Oliver-3

Sorry for the rather sparse solution. Glad you figured it out. Try applying the wkday format. That should give you the names of the days of the week, as long as you don't mind English names.


From: John F Hall <[hidden email]>
To: [hidden email]
Date: 07/01/2010 12:34 PM
Subject: Re: Day of week conversion from edate
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Rick
 
Thanks for this.  Saved me a lot of time after all day working on a different data set.  Had to think about your reply, but assumed (correctly) that it was a function.  It's given a numeric code, so all I have to do now is add labels.  Only second time I've used dates: some useful stuff on page 101 and 102 of the reference manual.
 
John Hall
----- Original Message -----
From: Rick Oliver
To: [hidden email]
Sent: Thursday, July 01, 2010 6:48 PM
Subject: Re: Day of week conversion from edate


xdate.wkday


From: John F Hall <johnfhall@...>
To: [hidden email]
Date: 07/01/2010 11:44 AM
Subject: Day of week conversion from edate
Sent by: "SPSSX(r) Discussion" <[hidden email]>






I need to generate a "day of week" variable with values "Sunday" thru "Saturday" from data in the following format.    

 
26.04.2010
26.04.2010
26.04.2010
26.04.2010
01.05.2010

 
This could be numeric with 1 thru 7 or a string with actual day names.  If it's easier, I already have a date-time variable in this format:

 
26-Apr-2010 12:51
26-Apr-2010 22:01
26-Apr-2010 22:01
26-Apr-2010 22:01
1-May-2010 15:48

 
Can anyone help?

 
TIA

 
John Hall