Results 1 to 2 of 2

Thread: Type Mismatch when using date functions

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    5

    Type Mismatch when using date functions

    Here's my code:

    Code:
    Dim testDate As Date
    
    testDate = #1/16/2012#
    
    'Get last day of month
    daysInMonth = Day(DateAdd("m", 1, testDate - Day(testDate) + 1) - 1)
    outputDate= CDate(Month(testDate) & "/" & daysInMonth & "/" & testDate)
    I get the failure on the last line. "Type mismatch". Is there something wrong with the way I'm defining my testDate value?

    Thank you.

    Edit: Just found the error. Very silly error. Feel free to delete this thread.

  2. #2
    Hyperactive Member Lenggries's Avatar
    Join Date
    Sep 2009
    Posts
    353

    Re: Type Mismatch when using date functions

    Congratulations on finding your own solution. However, for the benefit of other users, please post your solution to the error and then mark the thread as resolved.

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