PDA

Click to See Complete Forum and Search --> : Multiple counts ...


JorgeLedo
Feb 3rd, 2000, 07:09 AM
I'm :confused: ,

I'm making a DB app to an hospital and there is a question that is intrigging me.

I've to make a report (currently using Crystal RDC 6.0) with the amount of exams (severall kinds of exams) made by a department. The DB only gives me the exams by patient so I've to make an SQL like:

SQL = "Select * from tableX WHERE exam = '" & examKind & "' AND department = '" & departmentName & "'"

There are many kinds of exams so I need to do serveral re-calls of that SQL (it takes me to long. Is there an easy way ? I've tried:

SQL = "SELECT * from tablex WHERE department = '" & departmentName & "'"

and from there count record by record (rs.movenext) the kind of exam and add it to an array. TOO SLOW ...


Is there a simpler way ?

I know that every time in the past something like this appened to me there was allways a simpler way...

Thank in advance,

------------------
Jorge Ledo
j_ledo@hotmail.com
Portugal

sushant
Feb 3rd, 2000, 12:45 PM
You can create a view according your requirement in the database itself and use a simple SQl statement to filter out the data.

It will save a lot of time.

JorgeLedo
Feb 3rd, 2000, 10:26 PM
Done it that way.

Thank you shushant,

------------------
Jorge Ledo
j_ledo@hotmail.com
Portugal