Re: Working Days

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 58485
interpreted = N
texte = At 2:02 PM +0100 6/18/04, Mark Derrick wrote: >This is a little rough, but it should do exactly what you need. >(You'll need to use variable for the "Start" and "Stop" dates) > >[math show=f]Total_days={24/02/2004}-{01/02/2004}[/math] >[math show=f]working-days=0[/math] > >[loop start=0&end=[Total_days]] >[text show=f]day=[format days_to_date %a][math]{01/12/2003}+[index][/math][/format][/text] >[If (("[day]"="Sat") | ("[day]"="Sun"))] >[then][/then] >[else][text show=f]working-days=[math][working-days]+1[/math][/text][/else] >[/if] >[/loop] > >Working days: [working-days] Why are you setting [text] variables to the result of [math] operations in your [else] statement? Here's a smaller version (less engine processing) and it doesn't reply of "if" contexts. [text]startdate=02/01/2004[/text] [text]enddate=02/24/2004[/text] [math show=f]workingdays=0[/math] [loop start=[math]{[startdate]}[/math]&end=[math]{[enddate]}[/math]] [hideif |Sat|Sun|^[format days_to_date %a][index][/format]] [math show=f]workingdays=[workingdays]+1[/math] [/hideif] [/loop] Working Days=[workingdays] ------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Working Days ( Mark Derrick 2004)
  2. Re: Working Days ( Joe D'Andrea 2004)
  3. Re: Working Days - Corrected ( Steve Craig 2004)
  4. Re: Working Days - Corrected ( Bob Minor 2004)
  5. Re: Working Days - Corrected ( Mark Derrick 2004)
  6. Re: Working Days ( Steve Craig 2004)
  7. Re: Working Days ( Mark Derrick 2004)
  8. Working Days ( Steve Craig 2004)
  9. How many working days? ( This)
At 2:02 PM +0100 6/18/04, Mark Derrick wrote: >This is a little rough, but it should do exactly what you need. >(You'll need to use variable for the "Start" and "Stop" dates) > >[math show=f]Total_days={24/02/2004}-{01/02/2004}[/math] >[math show=f]working-days=0[/math] > >[loop start=0&end=[Total_days]] >[text show=f]day=[format days_to_date %a][math]{01/12/2003}+[index][/math][/format][/text] >[If (("[day]"="Sat") | ("[day]"="Sun"))] >[then][/then] >[else][text show=f]working-days=[math][working-days]+1[/math][/text][/else] >[/if] >[/loop] > >Working days: [working-days] Why are you setting [text] variables to the result of [math] operations in your [else] statement? Here's a smaller version (less engine processing) and it doesn't reply of "if" contexts. [text]startdate=02/01/2004[/text] [text]enddate=02/24/2004[/text] [math show=f]workingdays=0[/math] [loop start=[math]{[startdate]}[/math]&end=[math]{[enddate]}[/math]] [hideif |Sat|Sun|^[format days_to_date %a][index][/format]] [math show=f]workingdays=[workingdays]+1[/math] [/hideif] [/loop] Working Days=[workingdays] ------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/ Joe D'Andrea

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:

textA and Title? (1997) Location of Browser Info.txt file (1997) html email again... (2001) Multiple prices (1997) [WebDNA] Foreign characters (2009) (2009) Re[2]: Enhancement Request for WebCatalog-NT (1996) PROBLEMS WITH PROTECT TAG (2004) Setting up shop (1997) [searchString] (1997) Listserver problem (1997) Secure Sever and showcart errors (1997) [WebDNA] Styling search results [using css] (2009) Bug or syntax error on my part? (1997) Setting user and password (1999) Listfiles on network with NT (2000) [hideif] (1998) Uploading very large image files (2003) WebMerchant 1.6 and SHTML (1997) WebDNA security (2004) Sorry WebDNA server not running ????? (2002)