>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
browse for year(DateField) # 2004
To copy to a table or cursor:
select * from MyTable for year(DateField) # 2004;
into table 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)