Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql syntax
Message
 
 
À
20/04/2002 04:05:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00647177
Message ID:
00647207
Vues:
15
You can use a bunch of date functions as shown below.
lnDaysBack = 5   
SELECT *, Month(dob) AS MonthDob, Day(dob) AS DayDob ;
  FROM mytable ;
  WHERE dob BETWEEN DATE( YEAR(dob), MONTH(DATE()-lnDaysBack), DAY(DATE()-lnDaysBack)) And ;
                    DATE( YEAR(dob), MONTH(DATE()), DAY(DATE())) ;
  ORDER BY MonthDob, DayDob ;
  INTO CURSOR csrReult
>i have a date field which stores the birth date of employees.
>
>i want to extract (thru' sql) those employees whose birthdays fall 4-5 days before the system date on any given day and i would like to have the list sorted on only the day of the month value and not the entire date field
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform