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:

removelineitems (2000) Practice runs ? (1997) WebCat2b13 Command Reference Doc error (1997) Frames (1997) search zip codes ranges (2003) Show items based on login Password (2003) Looking for a Manual (1997) Thanks Grant (1997) Big Databases (1997) Content search & results (2008) Allowed fields in formulas.db (1998) [lookup] is case-sensitive, [lookup] is case sensitive... (2003) More than one db with the same namn (was: WC2f3) (1997) RE: what characters are replaced for tab and CR? (1998) Resume Catalog ? (1997) WebDNA Solutions ... sorry! (1997) Template Encrypt Speed (1998) Append command (2000) Bad Cookie / Internet Option / Internet Explorer (2004) listfiles bug(s) (2000)