I am running a CR11 on BOXI enterprise server that fails due to an "Invalid argument for database" error. When I run this report from CR on my desktop, it runs fine. I am using a .csv for the main datasource that is living on the enterprise server and I have two tables linked in that go directly to our database. Here is what the SQL query looks like (sorry, kind of long):
Daily Lab CSV.csv
SELECT `Daily_Lab_CSV_csv`.`ACCNUMBER`, `Daily_Lab_CSV_csv`.`RECDATEODBC`, `Daily_Lab_CSV_csv`.`PTNAME`, `Daily_Lab_CSV_csv`.`PTNUMBER`, `Daily_Lab_CSV_csv`.`COLLAGE`, `Daily_Lab_CSV_csv`.`PTSEX`, `Daily_Lab_CSV_csv`.`BIRTHDATEODBC`, `Daily_Lab_CSV_csv`.`ORIGINALEVENTTYPE`, `Daily_Lab_CSV_csv`.`PTORDERLOC`, `Daily_Lab_CSV_csv`.`TESTCODE`, `Daily_Lab_CSV_csv`.`RESULT`, `Daily_Lab_CSV_csv`.`LABDEPT`, `Daily_Lab_CSV_csv`.`ORDERPHYS`, `Daily_Lab_CSV_csv`.`RESULTLAB`, `Daily_Lab_CSV_csv`.`ORDERINGDIAGNOSISCODE`, `Daily_Lab_CSV_csv`.`QAABOVENORMAL`, `Daily_Lab_CSV_csv`.`QABELOWNORMAL`, `Daily_Lab_CSV_csv`.`RESULTNORMRNG`, `Daily_Lab_CSV_csv`.`PTORDERACCOUNT`, `Daily_Lab_CSV_csv`.`RESULTMODIFIERS`, `Daily_Lab_CSV_csv`.`CPTCODE`, `Daily_Lab_CSV_csv`.`RESULTMETHOD`, `Daily_Lab_CSV_csv`.`RESULTDATEODBC`, `Daily_Lab_CSV_csv`.`RESULTTIMEODBC`, `Daily_Lab_CSV_csv`.`ORDERLAB`, `Daily_Lab_CSV_csv`.`RECTIMEODBC`, `Daily_Lab_CSV_csv`.`CONTAINERID`
FROM `Daily Lab CSV.csv` `Daily_Lab_CSV_csv`
WHERE NOT (`Daily_Lab_CSV_csv`.`TESTCODE`='ADCAL' OR `Daily_Lab_CSV_csv`.`TESTCODE`='ADCAL1' OR `Daily_Lab_CSV_csv`.`TESTCODE`='ADCAL3' OR `Daily_Lab_CSV_csv`.`TESTCODE`='ADCAL7' OR `Daily_Lab_CSV_csv`.`TESTCODE`='DBILL' OR `Daily_Lab_CSV_csv`.`TESTCODE`='DBILL1' OR `Daily_Lab_CSV_csv`.`TESTCODE`='DBILL3' OR `Daily_Lab_CSV_csv`.`TESTCODE`='DBILL4' OR `Daily_Lab_CSV_csv`.`TESTCODE`='DTRAT' OR `Daily_Lab_CSV_csv`.`TESTCODE`='ELEFIX' OR `Daily_Lab_CSV_csv`.`TESTCODE`='MSR' OR `Daily_Lab_CSV_csv`.`TESTCODE`='MSR1' OR `Daily_Lab_CSV_csv`.`TESTCODE`='MSR4' OR `Daily_Lab_CSV_csv`.`TESTCODE`='OSED' OR `Daily_Lab_CSV_csv`.`TESTCODE`='OSED1' OR `Daily_Lab_CSV_csv`.`TESTCODE`='OSED3' OR `Daily_Lab_CSV_csv`.`TESTCODE`='OSED6' OR `Daily_Lab_CSV_csv`.`TESTCODE`='T1FIX' OR `Daily_Lab_CSV_csv`.`TESTCODE`='T2FIX' OR `Daily_Lab_CSV_csv`.`TESTCODE`='UBILL' OR `Daily_Lab_CSV_csv`.`TESTCODE`='UBILL1' OR `Daily_Lab_CSV_csv`.`TESTCODE`='UBILL3' OR `Daily_Lab_CSV_csv`.`TESTCODE`='UBILL6') AND `Daily_Lab_CSV_csv`.`LABDEPT`<>'ACCN'
EXTERNAL JOIN Daily_Lab_CSV_csv.CONTAINERID={?MSQLLAB: SMR_ContainerView.CID} AND Daily_Lab_CSV_csv.TESTCODE={?MSQLLAB: MA_TEST.TST}
MSQLLAB
SELECT SMR_ContainerView.ContainerCode, SMR_ContainerView.CID
FROM SYSTEM.SMR_ContainerView SMR_ContainerView
WHERE SMR_ContainerView.CID={?Daily Lab CSV.csv: Daily_Lab_CSV_csv.CONTAINERID}
MSQLLAB
SELECT MA_TEST.TSTName, MA_TEST.TST
FROM SYSTEM.MA_TEST MA_TEST
WHERE MA_TEST.TST={?Daily Lab CSV.csv: Daily_Lab_CSV_csv.TESTCODE}
Daily Lab CSV.csv
SELECT `Daily_Lab_CSV_csv`.`ACCNUMBER`, `Daily_Lab_CSV_csv`.`RECDATEODBC`, `Daily_Lab_CSV_csv`.`PTNAME`, `Daily_Lab_CSV_csv`.`PTNUMBER`, `Daily_Lab_CSV_csv`.`COLLAGE`, `Daily_Lab_CSV_csv`.`PTSEX`, `Daily_Lab_CSV_csv`.`BIRTHDATEODBC`, `Daily_Lab_CSV_csv`.`ORIGINALEVENTTYPE`, `Daily_Lab_CSV_csv`.`PTORDERLOC`, `Daily_Lab_CSV_csv`.`TESTCODE`, `Daily_Lab_CSV_csv`.`RESULT`, `Daily_Lab_CSV_csv`.`LABDEPT`, `Daily_Lab_CSV_csv`.`ORDERPHYS`, `Daily_Lab_CSV_csv`.`RESULTLAB`, `Daily_Lab_CSV_csv`.`ORDERINGDIAGNOSISCODE`, `Daily_Lab_CSV_csv`.`QAABOVENORMAL`, `Daily_Lab_CSV_csv`.`QABELOWNORMAL`, `Daily_Lab_CSV_csv`.`RESULTNORMRNG`, `Daily_Lab_CSV_csv`.`PTORDERACCOUNT`, `Daily_Lab_CSV_csv`.`RESULTMODIFIERS`, `Daily_Lab_CSV_csv`.`CPTCODE`, `Daily_Lab_CSV_csv`.`RESULTMETHOD`, `Daily_Lab_CSV_csv`.`RESULTDATEODBC`, `Daily_Lab_CSV_csv`.`RESULTTIMEODBC`, `Daily_Lab_CSV_csv`.`ORDERLAB`, `Daily_Lab_CSV_csv`.`RECTIMEODBC`, `Daily_Lab_CSV_csv`.`CONTAINERID`
FROM `Daily Lab CSV.csv` `Daily_Lab_CSV_csv`
WHERE NOT (`Daily_Lab_CSV_csv`.`TESTCODE`='ADCAL' OR `Daily_Lab_CSV_csv`.`TESTCODE`='ADCAL1' OR `Daily_Lab_CSV_csv`.`TESTCODE`='ADCAL3' OR `Daily_Lab_CSV_csv`.`TESTCODE`='ADCAL7' OR `Daily_Lab_CSV_csv`.`TESTCODE`='DBILL' OR `Daily_Lab_CSV_csv`.`TESTCODE`='DBILL1' OR `Daily_Lab_CSV_csv`.`TESTCODE`='DBILL3' OR `Daily_Lab_CSV_csv`.`TESTCODE`='DBILL4' OR `Daily_Lab_CSV_csv`.`TESTCODE`='DTRAT' OR `Daily_Lab_CSV_csv`.`TESTCODE`='ELEFIX' OR `Daily_Lab_CSV_csv`.`TESTCODE`='MSR' OR `Daily_Lab_CSV_csv`.`TESTCODE`='MSR1' OR `Daily_Lab_CSV_csv`.`TESTCODE`='MSR4' OR `Daily_Lab_CSV_csv`.`TESTCODE`='OSED' OR `Daily_Lab_CSV_csv`.`TESTCODE`='OSED1' OR `Daily_Lab_CSV_csv`.`TESTCODE`='OSED3' OR `Daily_Lab_CSV_csv`.`TESTCODE`='OSED6' OR `Daily_Lab_CSV_csv`.`TESTCODE`='T1FIX' OR `Daily_Lab_CSV_csv`.`TESTCODE`='T2FIX' OR `Daily_Lab_CSV_csv`.`TESTCODE`='UBILL' OR `Daily_Lab_CSV_csv`.`TESTCODE`='UBILL1' OR `Daily_Lab_CSV_csv`.`TESTCODE`='UBILL3' OR `Daily_Lab_CSV_csv`.`TESTCODE`='UBILL6') AND `Daily_Lab_CSV_csv`.`LABDEPT`<>'ACCN'
EXTERNAL JOIN Daily_Lab_CSV_csv.CONTAINERID={?MSQLLAB: SMR_ContainerView.CID} AND Daily_Lab_CSV_csv.TESTCODE={?MSQLLAB: MA_TEST.TST}
MSQLLAB
SELECT SMR_ContainerView.ContainerCode, SMR_ContainerView.CID
FROM SYSTEM.SMR_ContainerView SMR_ContainerView
WHERE SMR_ContainerView.CID={?Daily Lab CSV.csv: Daily_Lab_CSV_csv.CONTAINERID}
MSQLLAB
SELECT MA_TEST.TSTName, MA_TEST.TST
FROM SYSTEM.MA_TEST MA_TEST
WHERE MA_TEST.TST={?Daily Lab CSV.csv: Daily_Lab_CSV_csv.TESTCODE}