Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2002
    Location
    Nottingham - UK
    Posts
    113

    Unanswered: ASP DateTime Format Problem

    Hello folks

    Im using SQL 2000 & ASP

    I need to display the date from my SQL DateTime field in the following format;

    'August 2005'

    The closest I can get to this is;

    '24 August 2005'

    Can anyone help or point me in the right direction please ?

    Many thanks

    Donald

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    There are a few ways.... the most obvious to me would be something like
    Code:
    datDate = CDate(recordsetName("FieldName"))
    strDate = MonthName(Month(datDate)) & ' ' & Year(datDate)
    not sure if this will give you August 2005 or August 05 though...

    Check on the Month, Year, MonthName functions and you should be able to solve this problem easily.
    Last edited by rokslide; 10-24-05 at 23:16. Reason: missed the closing code tag

  3. #3
    Join Date
    Jul 2004
    Posts
    94
    Hi,
    For that you might need to use the MonthName() and Year().
    Priyanka
    Windows web hosting with ASP,.Net,PHP,Perl,MySQL support
    We help in making your dreams come true on internet!

  4. #4
    Join Date
    Oct 2005
    Location
    Karachi
    Posts
    6
    MonthName(datDate) will print full month name. i.e. August
    MonthName(datDate, True) will print month name in abbreviated form. i.e. Aug

Posting Permissions

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