Sep 13, 2004 #1 hawley Programmer Dec 16, 2002 37 US If you have a string that is equal to "June" how do you convert that to the month number, 06. I have found stuff on getmonth and such but I don't have the whole date. Just the month name. Thanks!!!
If you have a string that is equal to "June" how do you convert that to the month number, 06. I have found stuff on getmonth and such but I don't have the whole date. Just the month name. Thanks!!!
Sep 13, 2004 #2 Arthur1 MIS Apr 8, 2003 28 US Easy way would be just to use a case statment: string ls_month integer i_month_num Choose Case ls_month CASE 'June' i_month_num = 06 Case 'July' i_month_num = 07 End CHOOSE Upvote 0 Downvote
Easy way would be just to use a case statment: string ls_month integer i_month_num Choose Case ls_month CASE 'June' i_month_num = 06 Case 'July' i_month_num = 07 End CHOOSE
Sep 13, 2004 #3 pgaec Programmer Aug 4, 2003 161 AU Or... string ls_month integer li_month ls_month = 'June' select datepart(mm,'01 '+ls_month+' 2000') into :li_month using sqlca; Upvote 0 Downvote
Or... string ls_month integer li_month ls_month = 'June' select datepart(mm,'01 '+ls_month+' 2000') into :li_month using sqlca;