type mismatch error ?

Results 1 to 2 of 2

Thread: type mismatch error ?

  1. #1
    Join Date
    Dec 1969

    Default type mismatch error ?

    Can anyone tell me why I am getting a type mismatch error from the following line of code?<BR>ExpDate is a database field, vbShortDate<BR><BR>if DateDiff("d", Now(), ExpDate)&#060;=1 then Ag_ExpCount+1

  2. #2
    Join Date
    Dec 1969

    Default Yeah, but...

    ...even though it&#039;s a database field, is it a variant with a date/time subtype?<BR><BR>Do ExpDate = CDate(ExpDate) on the line above, to make sure.<BR><BR>Also, you don&#039;t increment values like that.<BR><BR>Ag_ExpCount = Ag_ExpCount + 1<BR><BR>Also, DateDiff may (doubt it, but may) return a string, rather than a numeric response. You may want to CInt() the result if you&#039;re still having problems...<BR><BR>Craig.

Posting Permissions

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