Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Dec 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formatting date (2000(sr3))

    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. <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Formatting date (2000(sr3))

    Change the declaration of dteY2 to

    Dim dteY2 As Integer

  3. #3
    4 Star Lounger
    Join Date
    Dec 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatting date (2000(sr3))

    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. <img src=/S/clever.gif border=0 alt=clever width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •