[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I reference specific dates: e.g.: 15th Jan for every Year, 2001, 2002, 2003 etc??


  • Date: Sat, 07 Feb 2009 11:20:53 -0700
  • From: Gary Fritz <fritz@xxxxxxxx>
  • Subject: Re: How do I reference specific dates: e.g.: 15th Jan for every Year, 2001, 2002, 2003 etc??

PureBytes Links

Trading Reference Links

Dennis' code works *if* the 15th is a trading day. You might want to change the test to something like:

if Month(Date) = 1 and DayOfMonth(Date) crosses over 14 then begin ...

The "crosses over" test is equivalent to saying "if DOM[1] <= 14 and DOM > 14". That should handle cases where the 15th falls on a weekend.
Gary


DH wrote:
If Month(Date) = 1 and DayOfMonth(Date) = 15 then begin
   do this;
   do that;
End;