Hello everyone,
I am trying to search our directory by, among other things, date and salary.
I have one column for date and one column for salary.
So far, I keep getting type mismath error on both salary and date.
Everything else seems to work.
Here is my code:
dateCheck = cdate(rs("fdate").value)
salary = rs("sal")
' Build our query based on the input.
strSQL = "SELECT id,min(incomeRevenue),max(incomeRevenue),companyName, address,city," _
& " state,zip_code,county,phone,faxnumber,incomeRevenue,employeeNumber, " _
& "headquarter,sic,naic, min(sal),max(sal),min(fdate),max(fdate) " _
& "FROM directorySearch" _
& "WHERE companyName LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "OR zip_code LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "OR phone LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "OR sal = '" & formatcurrency(salary,2) & " ' _
& "OR fdate = #" & dateCheck & "# _
& "GROUP BY id,companyName,address,city, state,zip_code,county,phone,faxnumber,incomeRevenue,employeeNumber,headquarter,sic,naic,fdate,sal " _
& "ORDER BY companyName;"
Your help is appreciated
I am trying to search our directory by, among other things, date and salary.
I have one column for date and one column for salary.
So far, I keep getting type mismath error on both salary and date.
Everything else seems to work.
Here is my code:
dateCheck = cdate(rs("fdate").value)
salary = rs("sal")
' Build our query based on the input.
strSQL = "SELECT id,min(incomeRevenue),max(incomeRevenue),companyName, address,city," _
& " state,zip_code,county,phone,faxnumber,incomeRevenue,employeeNumber, " _
& "headquarter,sic,naic, min(sal),max(sal),min(fdate),max(fdate) " _
& "FROM directorySearch" _
& "WHERE companyName LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "OR zip_code LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "OR phone LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "OR sal = '" & formatcurrency(salary,2) & " ' _
& "OR fdate = #" & dateCheck & "# _
& "GROUP BY id,companyName,address,city, state,zip_code,county,phone,faxnumber,incomeRevenue,employeeNumber,headquarter,sic,naic,fdate,sal " _
& "ORDER BY companyName;"
Your help is appreciated