Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql syntax
Message
 
 
To
20/04/2002 04:05:21
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00647177
Message ID:
00647207
Views:
14
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform