Hi,
I'm setting query SQL dynamically from a search form. Typical output is like this:
I need to refine it to filter out PRO_NO that do not contain a decimal. I'm thinking of using the instr() function but can't get the quotes right. For example, adding this
gives me an error (naturally) that Pro_No is not variable. I've tried many other ways of quoting the function parts and arguments without success
I'm not even sure I can do this, or do I have to create a 2nd query with the filter? Due to other factors, that would make things much more complex..
I'm setting query SQL dynamically from a search form. Typical output is like this:
Code:
qry.SQL = "SELECT DISTINCT dpay.PRO_NO, dpay.PKDATE, dpay.FROM, dpay.DPDATE, dpay.TO, dpay.DHMILE, dpay.LDMILE, dpay.MITOT, dpay.STOPTOT, dpay.UNLOAD, dpay.HOURS," & _
"dpay.HRTOT, dpay.SUBTOT, dpay.STOPS, dpay.tarptot, dpay.dettot, dpay.misctot, dpay.TOTPAY, dpay.SS_NO, tload.LOAD_TEMP, Driver.DRV_CODE," & _
" FROM Driver RIGHT JOIN (dpay INNER JOIN tload ON dpay.PRO_NO = tload.PRO_NO) ON Driver.SS_NO = dpay.SS_NO"
I need to refine it to filter out PRO_NO that do not contain a decimal. I'm thinking of using the instr() function but can't get the quotes right. For example, adding this
Code:
qry.SQL = qry.SQL & " AND " & InStr(ProNO, ".") = 0
I'm not even sure I can do this, or do I have to create a 2nd query with the filter? Due to other factors, that would make things much more complex..