Strip time from date?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jason

    Strip time from date?

    Could someone help me work out out a way to either convert a smalldatetime
    value from my database(access ) to a normal date with out the trailing time.

    Is it simple matter of using FormatDate or does one need to do string
    maniupulation?

    Current
    9/13/2003 11:36:00 AM

    What I want:
    9/13/2003

    Thanks
    Jason




  • Tom B

    #2
    Re: Strip time from date?

    If it's just for display then use FormatDateTime

    "jason" <jason@catamara nco.com> wrote in message
    news:%23RJkIzhe DHA.4024@TK2MSF TNGP11.phx.gbl. ..[color=blue]
    > Could someone help me work out out a way to either convert a smalldatetime
    > value from my database(access ) to a normal date with out the trailing[/color]
    time.[color=blue]
    >
    > Is it simple matter of using FormatDate or does one need to do string
    > maniupulation?
    >
    > Current
    > 9/13/2003 11:36:00 AM
    >
    > What I want:
    > 9/13/2003
    >
    > Thanks
    > Jason
    >
    >
    >
    >[/color]


    Comment

    • dlbjr

      #3
      Re: Strip time from date?

      If all you want to store in the database is the date then set this in the
      field properties in access

      For presentation purposes use

      dtmDate = "9/13/2003 11:36:00 AM" ' rs("date_field" )
      dtmDate = ConvertDate(dtm Date)

      Function ConvertDate(str 1)
      ConvertDate = "NAD"
      If IsDate(str1) Then
      ConvertDate= FormatDateTime( str1,2)
      End If
      End Function


      -dlbjr

      invariable unerring alien


      Comment

      Working...