scottmi1 Groupie
Joined: July 11 2006 Location: United States
Online Status: Offline Posts: 60
|
Posted: January 27 2007 at 08:03 | IP Logged
|
|
|
This macro checks to see if the current day is a holiday and if so, sets a global variable.
Mike..
insert into macroheader values ('CHECK_HOLIDAYS','HOLIDAY TODAY?',0,0,1);
insert into macrodetail values ('CHECK_HOLIDAYS',1,10,'HOLIDAY',NULL,'',0,'');
insert into macrodetail values ('CHECK_HOLIDAYS',2,16,'',NULL,'if(month(today()) = 1 and day(today()) = 1,ph_setglobal_s("HOLIDAY","New Years ") + 999,1)',0,'');
insert into macrodetail values ('CHECK_HOLIDAYS',3,16,'',NULL,'if(month(today()) = 1 and daynumber(today()) = 2 and day(today()) > 14 and day(today()) < 22,ph_setglobal_s("HOLIDAY","Martin Luther King Day") + 999,1)',0,'');
insert into macrodetail values ('CHECK_HOLIDAYS',4,16,'',NULL,'if(month(today()) = 1 and daynumber(today()) = 5 and daynumber(today()) = 2 and day(today()) > 24 and day(today()) <= 31,ph_setglobal_s("HOLIDAY","Memorial Day") + 999,1)',0,'');
insert into macrodetail values ('CHECK_HOLIDAYS',5,16,'',NULL,'if(month(today()) = 9 and daynumber(today()) = 2 and day(today()) <= 7,ph_setglobal_s("HOLIDAY","Labor Day") + 999,1)',0,'');
insert into macrodetail values ('CHECK_HOLIDAYS',6,16,'',NULL,'if(month(today()) = 11 and daynumber(today()) = 5 and day(today()) > 21 and day(today()) < 29,ph_setglobal_s("HOLIDAY","Thanksgiving Day") + 999,1)',0,'');
insert into macrodetail values ('CHECK_HOLIDAYS',7,16,'',NULL,'if(month(today()) = 11 and daynumber(today()) = 6 and day(today()) > 21 and day(today()) < 29,ph_setglobal_s("HOLIDAY","Day after Thanksgiving") + 999,1)',0,'');
insert into macrodetail values ('CHECK_HOLIDAYS',8,16,'',NULL,'if(month(today()) = 12 and daynumber(today()) > 2 and daynumber(today()) < 7 and day(today()) = 24,ph_setglobal_s("HOLIDAY","Christmas Eve") + 999,1)',0,'');
insert into macrodetail values ('CHECK_HOLIDAYS',9,16,'',NULL,'if(month(today()) = 12 and daynumber(today()) > 2 and daynumber(today()) < 7 and day(today()) = 25,ph_setglobal_s("HOLIDAY","Christmas Eve") + 999,1)',0,'');
Edited by scottmi1 - January 28 2007 at 09:22
|