Results 1 to 3 of 3

Thread: DateTimeFormat?

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Location
    New Orleans, LA
    Posts
    37
    I have a date value stored in access in this format:

    1/8/2000

    I need to parse all these dates out in this format:

    8/2000

    or

    82000

    basically, I just need the month and year as a string.

    how do i do this in VBscript?

    if it helps you show me the syntax, im pulling the date with this:

    rstNews("dtDate")

    which will return the above mentioned 1/8/2000

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Hi glitch13

    Nice and easy on this. just use the following

    <%
    Dim dtMonth
    Dim dtYear
    Dim dtDate

    dtMonth = Month(rstNews("dtDate"))
    dtYear = Year(rstNews("dtDate"))

    dtDate = dtMonth & "/" & dtYear
    %>

    Hope this helps

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2000
    Location
    New Orleans, LA
    Posts
    37
    thanks alot, works fine. I never new there were any other time/date formating functions other than DateTimeFormat()

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