If I wanted to compare a future date (has not occurred yet) that I have stored 
in a file and see if its < 15 days from the last bar (today) and return true if 
that were the case or false if not, how would I do that???

odbcOpenDatabase("DSN=Fin");
AB=CreateObject("Broker.Application");
temp = odbcGetArraySQL("select case timeofday when 'B' then 1 when 'A' then 1 
when 'D' then 1 when 'U' then 1 else 0 end,Date from epsreportdates where 
symbol='"+Name()+"'");
temp = IIf(temp ==1 AND IsNull(Ref(temp,-1)),1,0);
temp2 = odbcGetArraySQL("select date,Date from epsreportdates where 
symbol='"+Name()+"'");

y = LastValue(Year());
m = LastValue(Month());
d = LastValue(Day());
Ld = y * 10000 + m * 100 + d;
printf("\n y = "+y);printf("\n m = "+m);printf("\n d = "+d);
printf("\n ld = "+WriteVal(Ld,1.0));

ry = LastValue(ValueWhen(temp,Year()));
rm = LastValue(ValueWhen(temp,Month()));
rd = LastValue(ValueWhen(temp,Day()));
rLd = ry * 10000 + rm * 100 + rd;
printf("\n\n ry = "+ry);printf("\n rm = "+rm);printf("\n rd = "+rd);
printf("\n rld = "+WriteVal(rLd,1.0));

dif = Ld - rld;
printf("\n\n dif = "+dif);
printf("\n temp2 = "+WriteVal(temp2,1.0));

I was hoping that  dif would be something like 15 if temp2 were 15 days in the 
future, but I'm not getting that.  I think its because there are no bars out 
there.  I'm sure there's an easier way than this path I'm headed down.

Reply via email to