SIGNO
Olá Galera,
Onde encontro um exemplo de pesquisa por data de nascimento o mesmo informasse o signos?
O exemplo que encontrei aqui (vbmania) informa com data separada... dia/mes/ano
ficaria mais pratico apenas informando a data em formato 00/00/0000
Grato
Onde encontro um exemplo de pesquisa por data de nascimento o mesmo informasse o signos?
O exemplo que encontrei aqui (vbmania) informa com data separada... dia/mes/ano
ficaria mais pratico apenas informando a data em formato 00/00/0000
Grato
Se voce usar
Vai ter a data no padrao que esta precisando, se baseie no codigo do projeto que baixou e pronto.
dia = cdate(dia, mes, ano)
Vai ter a data no padrao que esta precisando, se baseie no codigo do projeto que baixou e pronto.
EU USEI ISSO A TEMPO VE SE SERVE :
A CHAMADA : Agecal ([DATANASCIMENTO)
Function Agecal(myDate As Variant) As Integer
myDate = CDate(txtDataNascimento.Text)
[ô]* MyDate is the var name for text1. We used CDate for conversion so you can
[ô]* enter the date as (25/12/1980 Euro dd/mm/yyyy) OR (12/25/1980 American mm/dd/yyyy)
[ô]* OR (1980/12/25 Arabic yyyy/mm/dd)
Dim Totaldays, Numyears, NumMonths, NumDays, signdate As Long
Dim sunsign As String
[ô]*we defined Totaldays as a number(Long) between -2000,000,000 and +2000,000,000
Totaldays = DateDiff([Ô]y[Ô], myDate, Date)
[ô]* Totaldays = Date Difference([Ô]Days[Ô], myDate, System[ô]s Date)
[ô]* =Total Number of days between Text1[ô]s date and Today[ô]s date. (Example: 7472 Days)
Numyears = Abs(Totaldays / 365.25)
[ô]* Numyears = Positive(Totaldays / 365.25). A year actaully has 365.25 Days
[ô]* =positive Number of years between Text1[ô]s date and Today[ô]s date.(Example: 20.4572 Years)
NumMonths = (Numyears - Int(Numyears)) * 365.25 / 30.4583
[ô]* NumMonths = (Numyears - No fractions(Numyears)) * 365.25 / 30.4583
[ô]* = ( .4572 ) * 365.25 / 30.4583
[ô]* Number of months between Text1date and Today[ô]s date. (Example: 5.4829 Months)
NumDays = CInt((NumMonths - Int(NumMonths)) * 30.4583)
[ô]* = Round( .4829 * 30.4583)
[ô]* Number of days. (Example: 15 Days)
signdate = CInt(Format(myDate, [Ô]mmdd[Ô])) [ô]* Here we format so Feb. 28th becomes 0228
Select Case signdate
Case 121 To 219 [ô]*AQUARIUS : (January 21 – February 19)
sunsign = [Ô]Aquário[Ô]
Case 220 To 320 [ô]*PISCES: (February 20 – March 20)
sunsign = [Ô]Peixes[Ô]
Case 321 To 420 [ô]*ARIES : (March 21 - April 20 )
sunsign = [Ô]Ãries[Ô]
Case 421 To 520 [ô]*TAURUS : (April 21 - May 20)
sunsign = [Ô]Touro[Ô]
Case 521 To 621 [ô]*GEMINI : (May 21 - June 21)
sunsign = [Ô]Gêmeos[Ô]
Case 622 To 723 [ô]*CANCER : (June 22 - July 23)
sunsign = [Ô]Câncer[Ô]
Case 724 To 823 [ô]*LEO : (July 24 - August 23)
sunsign = [Ô]Leão[Ô]
Case 824 To 923 [ô]*VIRGO : (August 24 - September 23)
sunsign = [Ô]Virgem[Ô]
Case 924 To 1022 [ô]*LIBRA : (September 24 - October 22)
sunsign = [Ô]Libra[Ô]
Case 1023 To 1122 [ô]*SCORPIO : (October 23 - November 22)
sunsign = [Ô]Escorpião[Ô]
Case 1123 To 1222 [ô]*SAGITTARIUS : (November 23 - December 22)
sunsign = [Ô]Sagitário[Ô]
Case Else [ô]*CAPRICORN : (December 23 - January 20)
sunsign = [Ô]Capricornio[Ô]
End Select
If myDate < Date Then [ô]* If Our Date is Before Today[ô]s Date ( PAST )
lblAnos.Caption = Int(Numyears) & [Ô] Anos, [Ô] & Int(NumMonths) & [Ô] Meses e [Ô] & Int(NumDays) & [Ô] Dias[Ô] & [Ô] Seu Signo é [Ô] & sunsign
Else [ô]* Otherwise, If Our Date is After Today[ô]s Date ( Future )
lblAnos.Caption = Int(Numyears) & [Ô] Anos, [Ô] & Int(NumMonths) & [Ô] Meses e [Ô] & Int(NumDays) & [Ô] Dias[Ô] & [Ô] Seu Signo é [Ô] & sunsign
End If
My_Idade = Int(Numyears)
Picture1.Picture = LoadPicture(DIRETORIO + [Ô]\signos\[Ô] & sunsign & [Ô].gif[Ô])
End Function
SE TIVER AS IMAGENS DE CADA SIGNO PODE COLOCAR TAMBEM.
MBOA SORTE
A CHAMADA : Agecal ([DATANASCIMENTO)
Function Agecal(myDate As Variant) As Integer
myDate = CDate(txtDataNascimento.Text)
[ô]* MyDate is the var name for text1. We used CDate for conversion so you can
[ô]* enter the date as (25/12/1980 Euro dd/mm/yyyy) OR (12/25/1980 American mm/dd/yyyy)
[ô]* OR (1980/12/25 Arabic yyyy/mm/dd)
Dim Totaldays, Numyears, NumMonths, NumDays, signdate As Long
Dim sunsign As String
[ô]*we defined Totaldays as a number(Long) between -2000,000,000 and +2000,000,000
Totaldays = DateDiff([Ô]y[Ô], myDate, Date)
[ô]* Totaldays = Date Difference([Ô]Days[Ô], myDate, System[ô]s Date)
[ô]* =Total Number of days between Text1[ô]s date and Today[ô]s date. (Example: 7472 Days)
Numyears = Abs(Totaldays / 365.25)
[ô]* Numyears = Positive(Totaldays / 365.25). A year actaully has 365.25 Days
[ô]* =positive Number of years between Text1[ô]s date and Today[ô]s date.(Example: 20.4572 Years)
NumMonths = (Numyears - Int(Numyears)) * 365.25 / 30.4583
[ô]* NumMonths = (Numyears - No fractions(Numyears)) * 365.25 / 30.4583
[ô]* = ( .4572 ) * 365.25 / 30.4583
[ô]* Number of months between Text1date and Today[ô]s date. (Example: 5.4829 Months)
NumDays = CInt((NumMonths - Int(NumMonths)) * 30.4583)
[ô]* = Round( .4829 * 30.4583)
[ô]* Number of days. (Example: 15 Days)
signdate = CInt(Format(myDate, [Ô]mmdd[Ô])) [ô]* Here we format so Feb. 28th becomes 0228
Select Case signdate
Case 121 To 219 [ô]*AQUARIUS : (January 21 – February 19)
sunsign = [Ô]Aquário[Ô]
Case 220 To 320 [ô]*PISCES: (February 20 – March 20)
sunsign = [Ô]Peixes[Ô]
Case 321 To 420 [ô]*ARIES : (March 21 - April 20 )
sunsign = [Ô]Ãries[Ô]
Case 421 To 520 [ô]*TAURUS : (April 21 - May 20)
sunsign = [Ô]Touro[Ô]
Case 521 To 621 [ô]*GEMINI : (May 21 - June 21)
sunsign = [Ô]Gêmeos[Ô]
Case 622 To 723 [ô]*CANCER : (June 22 - July 23)
sunsign = [Ô]Câncer[Ô]
Case 724 To 823 [ô]*LEO : (July 24 - August 23)
sunsign = [Ô]Leão[Ô]
Case 824 To 923 [ô]*VIRGO : (August 24 - September 23)
sunsign = [Ô]Virgem[Ô]
Case 924 To 1022 [ô]*LIBRA : (September 24 - October 22)
sunsign = [Ô]Libra[Ô]
Case 1023 To 1122 [ô]*SCORPIO : (October 23 - November 22)
sunsign = [Ô]Escorpião[Ô]
Case 1123 To 1222 [ô]*SAGITTARIUS : (November 23 - December 22)
sunsign = [Ô]Sagitário[Ô]
Case Else [ô]*CAPRICORN : (December 23 - January 20)
sunsign = [Ô]Capricornio[Ô]
End Select
If myDate < Date Then [ô]* If Our Date is Before Today[ô]s Date ( PAST )
lblAnos.Caption = Int(Numyears) & [Ô] Anos, [Ô] & Int(NumMonths) & [Ô] Meses e [Ô] & Int(NumDays) & [Ô] Dias[Ô] & [Ô] Seu Signo é [Ô] & sunsign
Else [ô]* Otherwise, If Our Date is After Today[ô]s Date ( Future )
lblAnos.Caption = Int(Numyears) & [Ô] Anos, [Ô] & Int(NumMonths) & [Ô] Meses e [Ô] & Int(NumDays) & [Ô] Dias[Ô] & [Ô] Seu Signo é [Ô] & sunsign
End If
My_Idade = Int(Numyears)
Picture1.Picture = LoadPicture(DIRETORIO + [Ô]\signos\[Ô] & sunsign & [Ô].gif[Ô])
End Function
SE TIVER AS IMAGENS DE CADA SIGNO PODE COLOCAR TAMBEM.
MBOA SORTE
Tópico encerrado , respostas não são mais permitidas