kapiaba Posted May 13, 2015 Report Share Posted May 13, 2015 /* Por uma data saber qual numero da semana dentro do mes - By DonDiego. Em dicas. */ #include "fivewin.ch" Function main() SET CENTURY ON SET EPOCH TO YEAR( DATE() ) - 50 SET DATE BRITISH SET DATE FORMAT "dd/mm/yyyy" ? SemanaMes( CTOD( "20/05/2015" ) ) // 4a. semana. return nil Function SemanaMes( data ) local n, retorno := 1 for n = 1 to val(subst(dtoc(data),1,2)) if UPPER(CDoW( ctod( strzero(n,2)+subst(dtoc(data),3,len(dtoc(data))-2) ) ))="SUNDAY" retorno++ endif next return retorno // FIM Quote Link to comment Share on other sites More sharing options...
zekasan Posted May 13, 2015 Report Share Posted May 13, 2015 Function SemanaMes( data )return (week(data) - week(bom(data)) + 1) kapiaba 1 Quote Link to comment Share on other sites More sharing options...
emotta Posted May 13, 2015 Report Share Posted May 13, 2015 Essa é ainda melhor: Function SemanaMes(dData) Return WoM(dData) Function SemanaMes( data )return (week(data) - week(bom(data)) + 1) kapiaba and zekasan 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.