I am dealing with 4 date fields in a function
@AsOfDate (passed to function)
@PaidDate (variable in function)
I want to set the value of the @PaidDate to the table.AppliedDate but if the table.AppliedDate is Null then I want to set the @PaidDate to table.PostDate
then I only want to select those records where the @PaidDate is <= to @AsOfDate.
I don't know how to do this.