Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Findout year except given year
Message
De
14/04/2005 09:47:07
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
13/04/2005 23:57:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01004465
Message ID:
01004629
Vues:
17
>Dear Sir,
>
>There is date type Field in Table1 and has data as follows
>
>01-01-2004
>05-01-2005
>04-08-2003
>06-03-2004
>07-10-2004
>09-05-2002
>
>I want to scan such dates that have years except year=2004 and 2005 for exapmle
>04-08-2003
>09-05-2002
>
>Please help

The condition might be year(DateField) # 2004, or - to ignore only two specific years - not inlist(year(DateField), 2003, 2005); or for a consecutive range of years: not between(year(DateField), 2001, 2003).

You can use any of these conditions in all sorts of ways, for instance:

To quickly show the records on screen (not appropriate for the end-user, only for the programmer):
display all for year(DateField) < 2004

* or:

browse for year(DateField) # 2004
To copy to a table or cursor:
select * from MyTable for year(DateField) # 2004;
  into table Temp

* or: ... into cursor Temp
The cursor is especially appropriate for use in a report, later on.

You might also set a filter, as suggested in another reply you got.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform