Results 1 to 9 of 9

Thread: Type mismatch in Date/Time value build, starting 1-October.

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2009
    Posts
    64

    Type mismatch in Date/Time value build, starting 1-October.

    This code has been working flawless for months of testing (of single digit month numbers?) until the calendar rolled over to 1-Oct or 10/1/2015.

    Now its has a Type Mismatch error 13.

    Here is the code:
    Code:
    Dim d0, d1, d2, d3 As Date
    Dim drt as Date
    'drt value loaded from database value, Format: Short Time, tested Medium Time, same prob.
    'drt = 8:00
            d0 = DateAdd("d", -1, Date) ' Gets previous day's date
            d1 = Format(Now(), Date) ' Gets today's date
            'No error to this point
            '--- Error in below 2 lines ---
            d2 = d0 & " " & drt  'Combine previous day's date & DRT
            d3 = d1 & " " & drt  'Combine today's date & DRT
    
    'Previous results looked like  d2 = 9/26/2015 8:00 AM, d3 = 9/27/2015 8:00 AM
    When I was creating this I could display the newly created d2 and d3 and they were perfect, and worked in my SQL string.

    I have tried everything I can think of.
    What might have changed simply by the month change?

    Any suggestions appreciated.
    Last edited by Enrique_; Oct 1st, 2015 at 11:46 AM.

Tags for this Thread

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