Results 1 to 3 of 3

Thread: Multiple counts ...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Oporto, Portugal
    Posts
    134

    Post

    I'm ,

    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
    [email protected]
    Portugal

  2. #2
    Junior Member
    Join Date
    Apr 1999
    Location
    Bangalore, KA, India
    Posts
    18

    Post

    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.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Oporto, Portugal
    Posts
    134

    Post

    Done it that way.

    Thank you shushant,

    ------------------
    Jorge Ledo
    [email protected]
    Portugal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width