Year(Date) Function

Discussion in 'ASP General' started by ltamisin, May 31, 2005.

  1. ltamisin

    ltamisin Guest

    Hi

    Im working on a Year(Date) function right now, the output of that function
    is this "2005", my question is how can i change the format into this "05"

    Function: Year(Date)
    Output: 2005
    Needed Output: 05

    Thanks
     
    ltamisin, May 31, 2005
    #1
    1. Advertising

  2. ltamisin

    Adrienne Guest

    Gazing into my crystal ball I observed "ltamisin" <>
    writing in news::

    > Hi
    >
    > Im working on a Year(Date) function right now, the output of that
    > function is this "2005", my question is how can i change the format
    > into this "05"
    >
    > Function: Year(Date)
    > Output: 2005
    > Needed Output: 05
    >



    Function Year(Date)
    Year = Right(Datepart("yyyy",Date),2)
    End Function

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne, May 31, 2005
    #2
    1. Advertising

  3. ltamisin

    ltamisin Guest

    Hey Adrienne thanks :)

    "Adrienne" <> wrote in message
    news:Xns9667CC894EACarbpenyahoocom@207.115.63.158...
    > Gazing into my crystal ball I observed "ltamisin" <>
    > writing in news::
    >
    > > Hi
    > >
    > > Im working on a Year(Date) function right now, the output of that
    > > function is this "2005", my question is how can i change the format
    > > into this "05"
    > >
    > > Function: Year(Date)
    > > Output: 2005
    > > Needed Output: 05
    > >

    >
    >
    > Function Year(Date)
    > Year = Right(Datepart("yyyy",Date),2)
    > End Function
    >
    > --
    > Adrienne Boswell
    > http://www.cavalcade-of-coding.info
    > Please respond to the group so others can share
     
    ltamisin, May 31, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hai Nguyen

    Date Validation Expression and Leap Year

    Hai Nguyen, Feb 26, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,347
    Hans Kesting
    Feb 27, 2004
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,365
    Michael Borgwardt
    May 30, 2004
  3. Otuatail

    Week of year to full Year

    Otuatail, Dec 8, 2003, in forum: HTML
    Replies:
    4
    Views:
    989
    Toby A Inkster
    Dec 8, 2003
  4. Veerle
    Replies:
    2
    Views:
    430
    niceguy
    Aug 20, 2003
  5. David Woodward
    Replies:
    5
    Views:
    444
    Dr John Stockton
    Feb 2, 2004
Loading...

Share This Page