#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2010
    Posts
    1
    Rep Power
    0

    How to convert a search a string field that represents a date


    I have a company from Italy that has used a string field for a date field and it's in the format of yy/mm/dd hh:mm:ss. So, 9-23-10 at 7:19PM at 23 seconds looks like:

    2010/03/23 19:19:23

    How can I convert and this string field based on a date to and from request:

    8/19/10 01:00:00 to 8/30/10 23:59:59
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,430
    Rep Power
    4539
    I don't quite understand what you're asking, but there are vbscript functions that may help. Check out the formatdatetime() and cdate() and cstr() functions.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Posts
    15
    Rep Power
    0
    Originally Posted by JackDWeb
    I have a company from Italy that has used a string field for a date field and it's in the format of yy/mm/dd hh:mm:ss. So, 9-23-10 at 7:19PM at 23 seconds looks like:

    2010/03/23 19:19:23

    How can I convert and this string field based on a date to and from request:

    8/19/10 01:00:00 to 8/30/10 23:59:59
    you'll want to use the datepart function explained here:

    w3schools .com/ vbscript/ func_datepart.asp

    to parse out the pieces and then assign each to a variable so they can be reassembled as a string with the desired sequence.

IMN logo majestic logo threadwatch logo seochat tools logo