Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Macros, Scripts, and Formulas Repository
 PowerHome Messageboard : PowerHome Macros, Scripts, and Formulas Repository
Subject Topic: MACRO: Check Holidays Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
scottmi1
Groupie
Groupie
Avatar

Joined: July 11 2006
Location: United States
Online Status: Offline
Posts: 60
Posted: January 27 2007 at 08:03 | IP Logged Quote scottmi1

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
Back to Top View scottmi1's Profile Search for other posts by scottmi1
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum