patoche Posted October 24, 2005 at 10:05 AM Report #5704 Posted October 24, 2005 at 10:05 AM Boas o todos. Ora vamos la ver os cranios que por aqui andam... ;) Preciso de um procedimento, em VB 6.0 que me ache a semana actual em que estamos consuante a data, partindo do principio que a semana começa ao Domingo. Ex: Dia 7 Fevereiro = Semana 6 Dia 18 abril = Semana 16
satanuke Posted October 24, 2005 at 10:21 AM Report #5705 Posted October 24, 2005 at 10:21 AM Não sou nenhum pro em VB, mas este topico que encontrei num forum pareçe-me ser bom. Private Function GetWeekNumber(ByVal expenseDate As Date) As Integer Return Math.Ceiling(expenseDate.DayOfYear / 7) End Function Fonte : http://www.developerfusion.co.uk/forums/topic-27118 tek.readers blog
patoche Posted October 24, 2005 at 11:18 AM Author Report #5706 Posted October 24, 2005 at 11:18 AM Da-me erros. Isso deve ser para Vb Net ou coisa do genero. A linha "Return Math.Ceiling(expenseDate.DayOfYear / 7)" Fica logo a vermelho mal faço enter Math.Ceiling, isto tb nao existe a nao ser que tenha que acrescentar alguma referencia ou objecto. Private Function GetWeekNumber(ByVal expenseDate As Date) As Integer XPTO = Math.Ceiling(expenseDate.DayOfYear / 7) End Function Ao correr assim da-me um erro no "espenseDate" diz: Invalid qualifier
vbmaster Posted October 24, 2005 at 01:07 PM Report #5712 Posted October 24, 2005 at 01:07 PM Adicionas o controlo MonthView, que se encontra no pacote Windows Common Controls 2.60 (SP4). A partir daí deves conseguir fazer o que queres... 😄 P.S.: Pede-se que este tópico seja movido para a secção vb6/vb.net
patoche Posted October 24, 2005 at 01:32 PM Author Report #5716 Posted October 24, 2005 at 01:32 PM Exactamente, basta acrescentar esse objecto, que ele proprio tem nas propriedades a Semana actual. MonthView1.Value = Date XPTO = MonthView1.Week Obrigado pela ajuda, ja tenho o meu assunto resolvido
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now