Re: Date Range Issue

This WebDNA talk-list message is from

2006


It keeps the original formatting.
numero = 63764
interpreted = N
texte = Looking at your example I would probably do something like this. May be another easier way, this may be overkill but anyways here it is: Pseudo Code: //Grab the month and create a new variable called 'nextMonth' [text]nextMonth=[math] [theMonth] + 1 [/math][/text] [text]nextYear=[theYear][/text] //Test to see if nextMonth is greater than 12, if so reset it to 1 (Jan) and also add a year to nextYear [showif [nextMonth]>12] [text][nextMonth]=1[/text] [text][nextYear]=[math][theYear]+1[/math][/text] [/showif] //Do your search [search db=some.db&rnDatedatarq=[theMonth]/1/[theYear] [nextMonth]/0/[nextYear]&Datetype=date] This should grab everything within the range. Hope it helps. -Adam Tana Adams wrote: >Hi, > >I'm looping through, searching a date ranges and am running into a problem >where it's pulling a few days into the next month when the number of days in >the month is less than 31. Here is my search code: > >[search db=some.db&rnDatedatarq=[theMonth]/1/[theYear] >[theMonth]/31/[theYear]&Datetype=date] > >Can anyone tell me how to avoid this problem? Do I actually need to know >the number of days in each month in the given year? > >Thanks, > >Tana > > >------------------------------------------------------------- >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/ > > ------------------------------------------------------------- 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: Date Range Issue ( Kenneth Grome 2006)
  2. Re: Date Range Issue ( "Tana Adams" 2006)
  3. Re: Date Range Issue ( Matthew Bohne 2006)
  4. Re: Date Range Issue ( "Adam O'Connor" 2006)
  5. Re: Date Range Issue ( Matthew Bohne 2006)
  6. Re: Date Range Issue ( Matthew Bohne 2006)
  7. Date Range Issue ( "Tana Adams" 2006)
Looking at your example I would probably do something like this. May be another easier way, this may be overkill but anyways here it is: Pseudo Code: //Grab the month and create a new variable called 'nextMonth' [text]nextMonth=[math] [theMonth] + 1 [/math][/text] [text]nextYear=[theYear][/text] //Test to see if nextMonth is greater than 12, if so reset it to 1 (Jan) and also add a year to nextYear [showif [nextMonth]>12] [text][nextMonth]=1[/text] [text][nextYear]=[math][theYear]+1[/math][/text] [/showif] //Do your search [search db=some.db&rnDatedatarq=[theMonth]/1/[theYear] [nextMonth]/0/[nextYear]&Datetype=date] This should grab everything within the range. Hope it helps. -Adam Tana Adams wrote: >Hi, > >I'm looping through, searching a date ranges and am running into a problem >where it's pulling a few days into the next month when the number of days in >the month is less than 31. Here is my search code: > >[search db=some.db&rnDatedatarq=[theMonth]/1/[theYear] >[theMonth]/31/[theYear]&Datetype=date] > >Can anyone tell me how to avoid this problem? Do I actually need to know >the number of days in each month in the given year? > >Thanks, > >Tana > > >------------------------------------------------------------- >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/ > > ------------------------------------------------------------- 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/ "Adam O'Connor"

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:

Many are called but only 6 make it to founditems. (2001) Summing fields (1997) format and math on the fly (1998) Help! WebCat2 bug (1997) Some Questions (1997) Alternating colors (1997) Registration Form (1998) Setting up shop (1997) Try not to laugh (2007) Help! WebCat2 bug (1997) Crazy dates (was: sorting dates) (1999) 404 error page issue (2005) Country & Ship-to address & other fields ? (1997) Need relative path explanation (1997) [WebDNA] Sending Email Problem (2008) WebCatalog seems to choke on large (2meg) html files. (1998) with Link i need to (1997) [SHOWIF]s and empty arguments (1997) Table Loop Hoops (2000) sort problems....bug or brain fart? (1997)