And an easy way to convert values to date is using the NumberToDate(YYYYMMDD) 
function:

WHERE DATEFIELD Between NumberToDate(20050621) AND (NumberToDate(20050621) - 
(365 * 3))

Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
 
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
 
Tel     +45 6311 4900
Direct  +45 6311 4908
Mob     +45 5156 1045
Fax     +45 6311 4949
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk/gis


-----Original Message-----
From: Ian Robertson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 21, 2005 5:45 PM
To: [EMAIL PROTECTED]
Cc: [email protected]
Subject: RE: MI-L Selecting only the last three years worth of data


Graham 
 
An alternative to Keith's answer could be: 
 
WHERE DATEFIELD > "Entered Date" - (365 * 3)
 
This calculates the date 3 years before but ignores leap years. See Appendix D: 
Creating Expressions in the MapInfo User Guide for further details about 
manipulating date values. 
 
Ian
 
 

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16875

Reply via email to