Re: SEARCH DATE RANGE

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 28630
interpreted = N
texte = >I've looked at the examples from provided from the Talk list regarding this similar issue but haven't correct results. > >Trying to do a search in our orders.db for a specific range of date. But their is something wrong with this code. You John Hill mentioned in the Talk List that you can't have two different comparison operators working on the same field name. So I created Groups like he suggested, but but the returned date ranges are scattered. > > >MY FORM > >
> > > > > >
>
> >RESULTS PAGE > >[search db=../orders.db&geDATEdatarq=[URL][STARTDATE][/URL]&GROUP2field=DATE&leGROUP2datarq=[URL][ENDDATE][/URL]&DATEsort=1&DATEsdir=de&max=[_max]] Okay, you have several problems here. First things first:1- Your form is URLing the name of a field. Field names never have to be URLed, only the VALUES need to be URLed -- and form values do not need to be URLed anyways whenever the form method=POST, which is generally the way forms are sent. So you can change your form to look like this instead:

2- There's no indication from your form to tell us what format the STARTDATE and ENDDATE values are in. Those values MUST be entered in the proper format, or else the search context won't work properly no matter how good the rest of your webdna code is ...3- Your database apparently has a field in in named DATE. This is a no-no, you should NEVER use field names that match webdna tag names, so change the field name in your db to dbDate for example.4- Your search context won't work because it has several problems. WHen addressing a db field that needs to be addressed using the group field technoique you have to NOT address that field by db field name, you must use the group field name. You used one group field name but not the other. My example below will show you what I mean.Assuming the date format entered into the STARTDATE and ENDDATE fields is correct, and after you make the other changed mentioned above, try one of these search context instead, they should both produce the results you seek. The first one illustrates the group field technique, and the other illustrates a range trpy of search:[search db=../orders.db&group1Field=dbDate&group2Field=dbDate&group1Type=date&group2Type=date&gegroup1datarq=[url][STARTDATE][/url]&legroup2datarq=[url][ENDDATE][/url]&dbDatesort=1&dbDatesdir=de&max=[_max]][search db=../orders.db&rndbDatedatarq=[STARTDATE] [ENDDATE]&dbDateType=date&dbDatesort=1&dbDatesdir=de&max=[_max]]================================ Kenneth Grome, WebDNA Consultant 808-737-6499 http://webdna.net ================================------------------------------------------------------------- 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: SEARCH DATE RANGE (Kenneth Grome 2000)
  2. SEARCH DATE RANGE (Robert Kudrle 2000)
  3. Re: SEARCH DATE RANGE (Conley Hanson 2000)
>I've looked at the examples from provided from the Talk List regarding this similar issue but haven't correct results. > >Trying to do a search in our orders.db for a specific range of date. But their is something wrong with this code. You John Hill mentioned in the Talk List that you can't have two different comparison operators working on the same field name. So I created Groups like he suggested, but but the returned date ranges are scattered. > > >MY FORM > >
> >[url]STARTDATE[/url] size=12> > >[url]ENDDATE[/url] size=12> > >
>
> >RESULTS PAGE > >[search db=../orders.db&geDATEdatarq=[url][STARTDATE][/URL]&GROUP2field=DATE&leGROUP2datarq=[url][ENDDATE][/URL]&DATEsort=1&DATEsdir=de&max=[_max]] Okay, you have several problems here. First things first:1- Your form is URLing the name of a field. Field names never have to be URLed, only the VALUES need to be URLed -- and form values do not need to be URLed anyways whenever the form method=POST, which is generally the way forms are sent. So you can change your form to look like this instead:

2- There's no indication from your form to tell us what format the STARTDATE and ENDDATE values are in. Those values MUST be entered in the proper format, or else the search context won't work properly no matter how good the rest of your webdna code is ...3- Your database apparently has a field in in named DATE. This is a no-no, you should NEVER use field names that match webdna tag names, so change the field name in your db to dbDate for example.4- Your search context won't work because it has several problems. WHen addressing a db field that needs to be addressed using the group field technoique you have to NOT address that field by db field name, you must use the group field name. You used one group field name but not the other. My example below will show you what I mean.Assuming the date format entered into the STARTDATE and ENDDATE fields is correct, and after you make the other changed mentioned above, try one of these search context instead, they should both produce the results you seek. The first one illustrates the group field technique, and the other illustrates a range trpy of search:[search db=../orders.db&group1Field=dbDate&group2Field=dbDate&group1Type=date&group2Type=date&gegroup1datarq=[url][STARTDATE][/url]&legroup2datarq=[url][ENDDATE][/url]&dbDatesort=1&dbDatesdir=de&max=[_max]][search db=../orders.db&rndbDatedatarq=[STARTDATE] [ENDDATE]&dbDateType=date&dbDatesort=1&dbDatesdir=de&max=[_max]]================================ Kenneth Grome, WebDNA Consultant 808-737-6499 http://webdna.net ================================------------------------------------------------------------- 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 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:

Re:2nd WebCatalog2 Feature Request (1996) Formating Tables w/[founditems] (1998) PCS Frames-Default page is solution! (1997) Sandbox DB permissions (2005) Listserver problem (1997) Emailer (1997) expired beta (1997) ConvertChars (2000) The List is Changing (1997) flushdatabases (1997) Setting up shop (1997) Problems getting parameters passed into email. (1997) Summing fields (1997) [WebDNA] group searching not working as expected. (2010) Can I invoke an ssi plugin from within a webcat page (1997) Emailer Error 550 (Was Strange Crash) (1998) Database Helper missing? (2000) Unix line endings (2003) Debug mode (1999) Error: Too many nested [xxx] contexts (WebTen only) (1997)