• Formatting date (2000(sr3))

    Author
    Topic
    #450134

    I have the following bit of code:
    Dim dteY As Date
    Dim dteY2 As Date
    dteY = #2/14/2008#
    dteY2 = Year(dteY)

    If I debug.print, dteY returns Feb 14, 2008 but dteY2 returns June 30, 1905. What I need to do is extract the Year out of the date for comparison purposes with data entered into a dialogue box. scratch

    Viewing 0 reply threads
    Author
    Replies
    • #1105280

      Change the declaration of dteY2 to

      Dim dteY2 As Integer

      • #1105284

        You’re quick. I just realized I needed to change dteY2 to Integer and came back to the computer to post back!

        Thanks as usual for the quick help. clever

    Viewing 0 reply threads
    Reply To: Formatting date (2000(sr3))

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: