Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Max and 30 Days Ago
Message
De
16/11/2000 09:29:44
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Select Max and 30 Days Ago
Divers
Thread ID:
00442606
Message ID:
00442606
Vues:
32
I have a table that has three fields
EquipId I
ReadDate DT
Meter N10.1

What I need to do is calculate how many hours each EquipId changed in the last 30 days. ReadDate is the DateTime of the meter reading (this is taken weekly). Meter is the reading from the hour meter.

Do I need to do three selects? One to select the max readdate meter and one to select 30 days ago and one to figure out the difference??

I know that I can do a MAX(ReadDate) to get the max date... How do I select a ReadDate that is closest to 30 days? Do I need to step back until ReadDate is > 30 then select on that date? Just thinking out loud...

Thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform