Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Location
    Texas
    Posts
    37

    Unanswered: Can I convert a string to a date?

    Dim myDate As Date
    Dim myTime As Variant
    Dim mystring As Variant


    myDate = Me.ActiveXCtl0.Value 'example 02/15/2004

    'is there a time function similar to the calendar function? didn't see one.
    myTime = Combo7 'example = 00:00:00

    mystring = myDate & " " & myTime
    'how do I convert mystring to a Date format?

    DoCmd.OpenReport "report", acViewPreview, , "[start_date] >= mystring"
    'I want to use the mystring variable as an argument ... doesn't work
    as is.

    basically I want to be able to convert
    mystring which = "02/15/2004 00:00:00" to a Date variable so I can use that as a qualifier for my "report" report.

    All help is truly appreciated.
    A2K - W2k
    Thanks & Regards
    Pete

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Is this a duplicate post? Same poster, three hours earlier, question already answered?
    All code ADO/ADOX unless otherwise specified.
    Mike.

  3. #3
    Join Date
    Jan 2004
    Location
    Texas
    Posts
    37

    Still not answer

    I looked at "mydbforums" and it didn't show the 1st thread ... figured it got lost or something ... still no answer. Still don't see the 1st thread. Oh well.
    A2K - W2k
    Thanks & Regards
    Pete

  4. #4
    Join Date
    Feb 2004
    Posts
    10
    http://www.dbforums.com/t983464.html

    You can find the threads you currently are participating in or have subscribed to by clicking on my dBforums in the upper right portion of the window.

    Due to the number of posts in this forum, your first post is on page 2 as I type. Probally be on page 3 or 4 tomorrow.

    Hope their answers help!

Posting Permissions

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