Re: Showif date > other date

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 56772
interpreted = N
texte = Actually I haven't had to do any range searches on the dates we store like this, but if I did I would probably just add a "daysSince0000" field to my db first, then run the range search on that new field. Here's all the code required to do this: [writefile xxx.hdr][getchars start=2&from=end][include xxx.hdr][/getchars]daysSince0000 [/writefile] [closedatabase xxx.db] [search db=xxx.db&neskudata=[blank]] [replacefounditems]daysSince0000=[math]{[MONTH]/[DAY]/[YEAR]}[/math][/replacefounditems] [/search] [text]firstDate=[math]{02/21/2004}[/math][/text] [text]lastDate=[math]{03/12/2004}[/math][/text] [search db=xxx.db&rndaysSince0000=[firstDate] [lastDate]] [founditems] [/founditems] [/search] I suppose you could save a couple lines of code by not setting the firstDate and lastDate values as text vars (instead just put the proper values directly into the search context) but this way is clearer to see I think. By the way, in the writefile context there's a tab character after the getchars context, and there's a carriage return character after the "daysSince0000" field name. This code also assumes that you've stored your three date components in the MONTH, DAY and YEAR field in the db, and that you use a separate .hdr file for your db (which everyone does now, right?) :) >You could pull out the month/day/year and set it in a text variable >that is then used in the range search. > >[text show=f]birthday=[v_month]/[v_day]/[v_year][/text] > >rndate_spreaddatarq=[birthday] [other_date]..... > >GK > >On Thu, 11 Mar 2004 17:48:27 -0800 > Jesse Proudman wrote: > >> >>How would you do a range search if your data was stored like that? -- Kenneth Grome WebDNA Programmer Outsource Service Provider Phone: +6332 255-6591 ------------------------------------------------------------- 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: Showif date > other date ( Alan White 2004)
  2. Re: Showif date > other date ( Kenneth Grome 2004)
  3. Re: Showif date > other date ( Jesse Proudman 2004)
  4. Re: Showif date > other date ( Kenneth Grome 2004)
  5. Re: Showif date > other date ( Tim Robinson 2004)
  6. Re: Showif date > other date ( Jesse Proudman 2004)
  7. Re: Showif date > other date ( Kenneth Grome 2004)
  8. Re: Showif date > other date ( "Gary Krockover" 2004)
  9. Re: Showif date > other date ( Jesse Proudman 2004)
  10. Re: Showif date > other date ( Kenneth Grome 2004)
  11. Re: Showif date > other date ( Tim Robinson 2004)
  12. Re: Showif date > other date ( Kenneth Grome 2004)
  13. Re: Showif date > other date ( Stuart Tremain 2004)
  14. Re: Showif date > other date ( Kenneth Grome 2004)
  15. Re: Showif date > other date ( Stuart Tremain 2004)
  16. Re: Showif date > other date ( Stuart Tremain 2004)
  17. Re: Showif date > other date ( Alan White 2004)
  18. Re: Showif date > other date ( devaulw@onebox.com 2004)
  19. Showif date > other date ( Alan White 2004)
Actually I haven't had to do any range searches on the dates we store like this, but if I did I would probably just add a "daysSince0000" field to my db first, then run the range search on that new field. Here's all the code required to do this: [writefile xxx.hdr][getchars start=2&from=end][include xxx.hdr][/getchars]daysSince0000 [/writefile] [closedatabase xxx.db] [search db=xxx.db&neskudata=[blank]] [replacefounditems]daysSince0000=[math]{[MONTH]/[DAY]/[YEAR]}[/math][/replacefounditems] [/search] [text]firstDate=[math]{02/21/2004}[/math][/text] [text]lastDate=[math]{03/12/2004}[/math][/text] [search db=xxx.db&rndaysSince0000=[firstDate] [lastDate]] [founditems] [/founditems] [/search] I suppose you could save a couple lines of code by not setting the firstDate and lastDate values as text vars (instead just put the proper values directly into the search context) but this way is clearer to see I think. By the way, in the writefile context there's a tab character after the getchars context, and there's a carriage return character after the "daysSince0000" field name. This code also assumes that you've stored your three date components in the MONTH, DAY and YEAR field in the db, and that you use a separate .hdr file for your db (which everyone does now, right?) :) >You could pull out the month/day/year and set it in a text variable >that is then used in the range search. > >[text show=f]birthday=[v_month]/[v_day]/[v_year][/text] > >rndate_spreaddatarq=[birthday] [other_date]..... > >GK > >On Thu, 11 Mar 2004 17:48:27 -0800 > Jesse Proudman wrote: > >> >>How would you do a range search if your data was stored like that? -- Kenneth Grome WebDNA Programmer Outsource Service Provider Phone: +6332 255-6591 ------------------------------------------------------------- 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/ Kenneth Grome

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:

Big Databases (1997) How do you hide [math]stuff[/math] (1997) showif and cart (1997) quotation marks (2004) What am I doing wrong? (2000) Webcat 4.5.1 equivalent of autonumber (2003) Has this happened to you? (was:Emailer Chokes on bad address) (1997) in header include files? (1998) [isfolder] and [filename] (1997) Just Testing (1997) [WebDNA] OT? - how to get webdna to tell browser to open SWF directly in the browser? (2009) WebCat2b12plugin - [search] is broken ... not! (1997) WebCat2 beta 11 - new prefs ... (1997) Feature request: user-defined cart headers (1999) [shownext max=?] armed (1997) Default admin bug and how tech support reacted to it. (2000) WebCat2b12 CGI Mac - [shownext] problem (1997) WebCat2b13MacPlugIn - syntax to convert date (1997) Using Checkbox (2000) Pull Down Search (2000)