Re: Business Days from today.

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 26361
interpreted = N
texte = Sorry for taking so long bob....read my note on top to see why.... [!] This code tells you how many days FROM today (but NOT counting today) it will actually take to be equivalent to m_numDays business days. If you want the code to count today as a possible day as well, modify the code accordingly I've separated each of these items out so you can see it step by step. Combine for efficiency as necessary....SIDE NOTE: 1. Why do I name my variables this way? To avoid confusion, add clarity, and avoid collision. As a habit, I code all form variables to begin with an underscore (_), all text variables to begin with a t_, and all math variables with a m_. In this way, I can avoid messy variable hierarchial problems if a form/math/text variable has the same name as a reserved word or database field. 2. I was dissapointed that I couldn't initially figure out how to do this COMPLETELY mathematically....that's why I took so long to post. I know there is a way to do it without any showif's at all, so if I figure that one out, I'll post it. Sorry [/!][!]How many business days? Make this a form input or whatever ya need.[/!] [math show=f]m_numDays=7[/math][!]Gets today's date and puts it into number of days from whatever that beginning date, whatever it is...[/!] [math show=f]m_today={[date]}[/math][!]This decides how many FULL business weeks there are basked on the number of days asked, and multiplies that number by 2 days (per weekend). I floor in order to round the number down[/!] [math show=f]m_mustAdd=(floor([m_numDays]/5))*2[/math][!]This figures out how many days are left in the current week before the weekend hits us[/!] [math show=f]m_DaysLeft=5-[date %w][/math][!]Make a quick Adjustment[/!] [showif [m_DaysLeft]<[m_numDays]][math show=f]m_mustAdd=m_mustAdd+2[/math][/showif][!]Spits out the the number of days you need to add to your current date (m_today) to get the real date you're actually looking for[/!] [math][m_numDays]+[m_mustAdd][showif [m_numDays]\5]-2[/showif][/math][!]The date that is m_numDays business days from today[/!] [format days_to_date %m/%d/%Y][math][m_today]+[m_mustAdd][/math][/format]At 02:23 PM 1/21/00 -0600, you wrote: >Any quickies for calcualating 3/5/7 business days from [date]? > >Robert Minor >Director of Internet Services >------------------------------------------------------------ >Cybermill Communications >http://www.cybermill.com http://www.merchantmaker.com > >Providing Ecommerce and interactive website development and >hosting services on Macintosh, Windows NT, Unix, and AS/400. > > >------------------------------------------------------------- >Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. >To end your Mail problems go to . > >This message is sent to you because you are subscribed to > the mailing list . >To unsubscribe, E-mail to: >To switch to the DIGEST mode, E-mail to > =============================================== Howard Wolosky Lead Programmer / Webmaster Lab2K, LLC +The Pubb - The best solution for your messageboard needs. Written in 100% Webcat. (www.thepubb.com) +Will It Work? -The World's Largest Year 2000 Compliance Search Engine (www.willitwork.com) ===============================================------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Associated Messages, from the most recent to the oldest:

    
  1. Re: Business Days from today. (Howard Wolosky 2000)
  2. Business Days from today. (Bob Minor 2000)
Sorry for taking so long bob....read my note on top to see why.... [!] This code tells you how many days FROM today (but NOT counting today) it will actually take to be equivalent to m_numDays business days. If you want the code to count today as a possible day as well, modify the code accordingly I've separated each of these items out so you can see it step by step. Combine for efficiency as necessary....SIDE NOTE: 1. Why do I name my variables this way? To avoid confusion, add clarity, and avoid collision. As a habit, I code all form variables to begin with an underscore (_), all text variables to begin with a t_, and all math variables with a m_. In this way, I can avoid messy variable hierarchial problems if a form/math/text variable has the same name as a reserved word or database field. 2. I was dissapointed that I couldn't initially figure out how to do this COMPLETELY mathematically....that's why I took so long to post. I know there is a way to do it without any showif's at all, so if I figure that one out, I'll post it. Sorry [/!][!]How many business days? Make this a form input or whatever ya need.[/!] [math show=f]m_numDays=7[/math][!]Gets today's date and puts it into number of days from whatever that beginning date, whatever it is...[/!] [math show=f]m_today={[date]}[/math][!]This decides how many FULL business weeks there are basked on the number of days asked, and multiplies that number by 2 days (per weekend). I floor in order to round the number down[/!] [math show=f]m_mustAdd=(floor([m_numDays]/5))*2[/math][!]This figures out how many days are left in the current week before the weekend hits us[/!] [math show=f]m_DaysLeft=5-[date %w][/math][!]Make a quick Adjustment[/!] [showif [m_DaysLeft]<[m_numDays]][math show=f]m_mustAdd=m_mustAdd+2[/math][/showif][!]Spits out the the number of days you need to add to your current date (m_today) to get the real date you're actually looking for[/!] [math][m_numDays]+[m_mustAdd][showif [m_numDays]\5]-2[/showif][/math][!]The date that is m_numDays business days from today[/!] [format days_to_date %m/%d/%Y][math][m_today]+[m_mustAdd][/math][/format]At 02:23 PM 1/21/00 -0600, you wrote: >Any quickies for calcualating 3/5/7 business days from [date]? > >Robert Minor >Director of Internet Services >------------------------------------------------------------ >Cybermill Communications >http://www.cybermill.com http://www.merchantmaker.com > >Providing Ecommerce and interactive website development and >hosting services on Macintosh, Windows NT, Unix, and AS/400. > > >------------------------------------------------------------- >Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. >To end your Mail problems go to . > >This message is sent to you because you are subscribed to > the mailing list . >To unsubscribe, E-mail to: >To switch to the DIGEST mode, E-mail to > =============================================== Howard Wolosky Lead Programmer / Webmaster Lab2K, LLC +The Pubb - The best solution for your messageboard needs. Written in 100% Webcat. (www.thepubb.com) +Will It Work? -The World's Largest Year 2000 Compliance Search Engine (www.willitwork.com) ===============================================------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Howard Wolosky

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

HTTP header line is too long? (1997) [WriteFile] problems (1997) [TaxableTotal] - not working with AOL and IE (1997) WC2.0 Memory Requirements (1997) [WebDNA] Populate Bootstrap Modal with AJAX WebDNA (2015) validatin on NT (sorry for the dups and etc) (1998) really wierd browser truncating (1997) Is there an easier way? (1998) db protection on NT (1997) Re(2): Small Bug: ErrorLog.txt/[FORMVARIABLES]/[ORDERFILE] (1998) [OT] Satellite (2005) WebCat2b13MacPlugIn - [shownext method=post] ??? (1997) File Upload (1997) Way Off Topic (2003) using showpage and showcart commands (1996) Web Archives (2003) select multiple 2 more cents (1997) Error Lob.db records error message not name (1997) Date Formats (1997) WebCat2b13MacPlugin - nested [xxx] contexts (1997)