I have a very simple function that I wrote to compare two number fields. One field has 5 digits and another field has 7 digits. I only care about the first 5 digits in the second field so I have a small function that trims the number and then does a compare and produces a result of 1 if it matches the conditions of the if statement, otherwise it produces a 0. When I enter the function into an access query it runs without issue. As soon as I put criteria that I want the function to only equal 1, below the function, the query freezes upon running and I cannot get out of it. Below is the function. If someone could help me I'd really appreciate it...
Option Compare Database
Public Function fnOVERBILL(BILLDATE As Double, MBHTDT As Double) As Double
Dim TERM As Double
TERM = CLng(Left(MBHTDT, 5))
If (BILLDATE > TERM) And (MBHTDT > 0) Then
fnOVERBILL = 1
fnOVERBILL = 0