How to get only the year in the date in vb 6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • slapshock
    New Member
    • Oct 2006
    • 57

    How to get only the year in the date in vb 6.0

    Can anyone help me on how to get only year in a date...

    e.g. 09/15/1986

    i want to get only the 1986....please give me some idea on how to do this....

    thanks in advance...
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by slapshock
    Can anyone help me on how to get only year in a date.
    Sure, just use the Year() function. It accepts a date value as input, so if you have a string you might need to convert it to a date variable first.

    Comment

    • jrtox
      New Member
      • Sep 2007
      • 89

      #3
      Originally posted by slapshock
      Can anyone help me on how to get only year in a date...

      e.g. 09/15/1986

      i want to get only the 1986....please give me some idea on how to do this....

      thanks in advance...

      Textyear.Text = Year(09/15/1986)

      Regards

      Comment

      • Ali Rizwan
        Banned
        Contributor
        • Aug 2007
        • 931

        #4
        Originally posted by slapshock
        Can anyone help me on how to get only year in a date...

        e.g. 09/15/1986

        i want to get only the 1986....please give me some idea on how to do this....

        thanks in advance...
        Hello
        Use Year(Your Date) for year
        Month(Your Date) for month
        Day(Your Date) for day

        GOOD LUCK

        Comment

        • april lee

          #5
          Thank you so much for this really helped :*

          Comment

          Working...