Results 1 to 3 of 3

Thread: Formatting Date Fields

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    UK
    Posts
    5

    Lightbulb

    I have dates which i need to perform calucations upon (add 14 days to etc), which are held in a database. I can easily do this by using the DateAdd function. The only problem being is that I can only format the date into the following format:-

    21 June 2000

    When I need the date to be in the format:-

    21st June 2000

    Any ideas would be much appreciated !

    Thanx !

  2. #2
    Member
    Join Date
    Jan 2000
    Location
    Southbridge, MA, USA
    Posts
    40
    Interesting. If you try to place strDayDate into the Format(Now, "..."), it gives you something like 17t16 May 2000.
    What follows works correctly, even though it's ugly.

    Dim strDayDate As String
    Dim nDay As Integer

    nDay = CInt(Day(Now))

    Select Case nDay
    Case 1, 21, 31
    strDayDate = nDay & "st"
    Case 2, 22
    strDayDate = nDay & "nd"
    Case 3, 23
    strDayDate = nDay & "rd"
    Case Else
    strDayDate = nDay & "th"
    End Select

    Debug.Print strDayDate & Format(Now, " mmm yyyy")

    [Edited by cfmoxey on 05-18-2000 at 09:25 AM]

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    UK
    Posts
    5

    Talking

    Thanks.....I'll give it a blast !

    ;p

Posting Permissions

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



Click Here to Expand Forum to Full Width