Im trying to create a union query w/ 7 select statements for a report in crd 6 the db is access 97 with a dao connection. the query works in access but not in crystal report the following is the syntax used. <br>
SELECT distinctrow citation_num,lea,toxicologist_name,lab_number,name,name2,add1,add2,city,state,zip from blood_lab,spcl_witnesses where blood_lab.lab_id = spcl_witnesses.lab_id <br>
union <br>
select distinctrow citation_num,lea,null,instrument_num,name,name2,add1,add2,city,state,zip from bac_lab,spcl_witnesses where bac_lab.lab_id = spcl_witnesses.lab_id <br>
union <br>
select distinctrow citation_num,lea,null,batch_number,name,name2,add1,add2,city,state,zip from toxicology_lab,spcl_witnesses where toxicology_lab.lab_id = spcl_witnesses.lab_id <br>
union <br>
select distinctrow citation_num,lea,scientist_name,lab_number,name,name2,add1,add2,city,state,zip from crime_lab,spcl_witnesses where crime_lab.lab_id = spcl_witnesses.lab_id <br>
union <br>
select distinctrow citation_num,lea,scientist_name,lab_number,name,name2,add1,add2,city,state,zip from marijuana_lab,spcl_witnesses where marijuana_lab.lab_id = spcl_witnesses.lab_id <br>
UNION select distinctrow citation_num,lea,null,null,name,null,address,null,cities,state,zip from witness_info <br>
order by citation_num; <br>
<br>
i have tried order by 1 and not using an order clause .I have also tried buiding the query in the sql expert <br>
I just started using crystal reports a month ago. <br>
thanks in advance for the help<br>
<br>
SELECT distinctrow citation_num,lea,toxicologist_name,lab_number,name,name2,add1,add2,city,state,zip from blood_lab,spcl_witnesses where blood_lab.lab_id = spcl_witnesses.lab_id <br>
union <br>
select distinctrow citation_num,lea,null,instrument_num,name,name2,add1,add2,city,state,zip from bac_lab,spcl_witnesses where bac_lab.lab_id = spcl_witnesses.lab_id <br>
union <br>
select distinctrow citation_num,lea,null,batch_number,name,name2,add1,add2,city,state,zip from toxicology_lab,spcl_witnesses where toxicology_lab.lab_id = spcl_witnesses.lab_id <br>
union <br>
select distinctrow citation_num,lea,scientist_name,lab_number,name,name2,add1,add2,city,state,zip from crime_lab,spcl_witnesses where crime_lab.lab_id = spcl_witnesses.lab_id <br>
union <br>
select distinctrow citation_num,lea,scientist_name,lab_number,name,name2,add1,add2,city,state,zip from marijuana_lab,spcl_witnesses where marijuana_lab.lab_id = spcl_witnesses.lab_id <br>
UNION select distinctrow citation_num,lea,null,null,name,null,address,null,cities,state,zip from witness_info <br>
order by citation_num; <br>
<br>
i have tried order by 1 and not using an order clause .I have also tried buiding the query in the sql expert <br>
I just started using crystal reports a month ago. <br>
thanks in advance for the help<br>
<br>