Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
85 selects on a large database - looking for a way to simpli
Message
From
28/07/1999 10:22:56
Dag Arneson
Cornell Univerity Hotel School
Ithaca, New York, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
85 selects on a large database - looking for a way to simpli
Miscellaneous
Thread ID:
00247128
Message ID:
00247128
Views:
54
I am trying to create a report for use of a computer lab. There are 5 separate sub-labs which I want to separate, and 17 different hours, 8 am - 12 midnight. The way I am currently using uses 17 * 5 or 85 select statements. As the log file size increases, these select statements could take quite a while. Is there a better (faster) way to do this?
FOR labnum = 1 to 5
  FOR hournum = 8 TO 24
    SELECT uselog.time_in, uselog.time_out, computer.res_loc ;
      FROM uselog INNER JOIN computer ;
      ON ((uselog.comp_id = computer.res_id) AND (computer.res_loc = labnum) AND ;
      (BETWEEN(DTOT(gdreportdate)+(hournum*3600), uselog.time_in, uselog.time_out))) ;
      INTO CURSOR useless  && So a browse window doesn't pop up
    gausage[labnum, hournum - 7] = _TALLY
    SELECT useless
    USE
   ENDFOR
ENDFOR
Next
Reply
Map
View

Click here to load this message in the networking platform