first. and Last. logic statement

#1
hi,

I have two lines of data,

ID Order
A 17/01/2016
B 01/02/2014

Basically I want to run a logic like so;
data Aimee.test_active;
set Aimee.Weekly_Email_files_cleaned4;
by ID;
length active :8.;
length inactive :8.;
if first.Order between '01Jan2014'd and '31Dec2015'd then active= 1;
if last.order between '01Jan2014'd and '31Dec2015'd then inactive= 1;

run;

the field "Order" is formatted by DDMMYY10 when I checked the file properties, but I keep getting this error
ERROR 388-185: Expecting an arithmetic operator.

Can anyone help or suggest something different in the same vain?

thanks