Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Seek for datetime records within month using index
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01075055
Message ID:
01075071
Vues:
17
>Is there a way to find records based on a date field within a month and year using an index rather than an append from? I'm using a visual calendar and need to display information on the days showing within the current displayed month & year and quickly change the display if the month and or year changes. I want to use an index to make the display change fast. Is there some date command that can be used to search an indexed date field based on just the month and year so I can quickly populate a temp database with all records that fall within that month and year?
>
>Thanks!
>Colombo.
INDEX ON LEFT(DTOS(YourDateField),6) && This can be permanent index to make SELECT to be optimisable.

lcWherePeriod = STR(m.Year,4)+RIGHT("0"+TRANSFORM(m.month),2)
SELECT * FROM Table WHERE LEFT(DTOS(YourDateField),6) == lcWherePeriod INTO CURSOR crsToDisplay
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform