Im have trouble getting in where it says birthday only with the year

Hi,I'm having trouble with my birthday where the year 1966
Karen HallsAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Gustav BrockConnect With a Mentor CIOCommented:
That will be:

Public Function ShowBirthday1966(ByVal Birthday As Date)

    Const BirthdayYear As Integer = 1966

    Dim Birthday1966 As Variant
    Dim Title As String

    Title = "Birthday" & Str(BirthdayYear)

    If Year(Birthday) > BirthdayYear Then
        Birthday1966 = Null
        MsgBox "You were not born.", vbExclamation + vbOkOnly, Title
    Else
        Birthday1966 = DateSerial(BirthdayYear, Month(Birthday), Day(Birthday))
        MsgBox "Your birthday of" & Str(BirthdayYear) & " is " & Format(Birthday1966, "yyyy-mm-dd"), vbInformation + vbOkOnly, Title
    End If

    ShowBirthday1966 = Birthday1966 

End Function

Open in new window

Now call this (replace 1/1/1980 with your birthday):

? ShowBirthday1966(#1/1/1980#)
0
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
not sure to understand. can you elaborate more on your structure and what you are trying to do?

blind guess:
select * from yourtable where year(yourdatefield) = 1966

Open in new window

0
 
Pawan KumarDatabase ExpertCommented:
Can you provide more information like table structure and what you are trying to achieve.
0
 
Gustav BrockCIOCommented:
The answers are best guesses.
0
All Courses

From novice to tech pro — start learning today.