Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Boolean Challenge Anyone?
Message
De
29/12/2007 18:08:54
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
29/12/2007 17:37:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01278379
Message ID:
01278384
Vues:
16
>I have an application that tracks a person’s scheduled daily activities in two integer fields by setting a single bit for each 15-minute block of time. With 32 bits in each field, that gives me 16 hours of coverage for a day and I can safely ignore the back side of the clock, so that is sufficient.
>
>I now have to create an availability chart with a single record for each individual that shows all scheduled 15-minute blocks for a day. Since each person may have more than one record for a day, showing different scheduled periods, that involves a BITOR() of each of the relevant integer fields in those records to combine all scheduled blocks into a single record with the same pair of integer fields.
>
>Can any of you clever people come up with an elegant way to accomplish this—inside a SQL SELECT—or otherwise? Something better than a brute-force SCAN FOR or DO WHILE loop for each individual? I’ve wracked my brain for longer than I want to admit without coming up with anything approaching “elegant.”

If you can guarantee that no bit is set more than once, you can simply sum these fields.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform