RE: Sorting error

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 13474
interpreted = N
texte = Michael ->For the sake of simplicity (and trying to isolate any errors), I've created >a small database with 5 fields (sku, title, mth, day, yr) and 12 records >(all of which have titles that start with Will to Power, like Will to >Power #1, Will to Power #2, etc.). MTH, DAY, and YR are all numeric >values that, when sorted by YR, then MTH, then DAY in Excel, give me the >order that I want (Will To Power #1 first, Will to Power #12 last). >When I sort the same way using WebCat (below), I get a seemingly random >order (#6, #8, #5, #9, ...) The sorted order doesn't even match the order >of records in the database. >[SEARCH >db=DB/Test.db&bwtitledata=Will&allhit=1&YRsort=1&MTHsort=2&DAYsort=3&YRtype=num&MTHtype=num&DAYtype=num] [FOUNDITEMS][TITLE] ([MTH]/[DAY]/[YR])
[/FOUNDITEMS] >[/SEARCH]I can see the same problem here. I'm not sure what's going on, but if you'd like to work around it in the meantime, try replacing all the 1-digit values in the MTH and DAY fields with 2-digit values (so that '2' becomes '02' -- you can do a replace that searches for values less than 10 and replaces them with '0[mth]' or '0[day]'). Remove the '&MTHtype=num&DAYtype=num' parameters from your search and everthing should sort correctly. If you want the output to look like '2/8/1997', just change the text in the [founditems] context to ([math][MTH][/math]/[math][DAY][/math]/[YR]).Hope this helps for now,Marc Eagle StarNine Technologies http://www.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Sorting error (John Hill 1997)
  2. Re: Sorting error (Kenneth Grome 1997)
  3. Re: Sorting error (Michael Winston 1997)
  4. RE: Sorting error (Marc Eagle 1997)
  5. Re: Sorting error (Michael Winston 1997)
  6. Re: Sorting error (Michael Winston 1997)
  7. Re: Sorting error (John Hill 1997)
  8. Re: Sorting error (Kenneth Grome 1997)
  9. Re: Sorting error (Kenneth Grome 1997)
  10. Re: Sorting error (John Hill 1997)
Michael ->For the sake of simplicity (and trying to isolate any errors), I've created >a small database with 5 fields (sku, title, mth, day, yr) and 12 records >(all of which have titles that start with Will to Power, like Will to >Power #1, Will to Power #2, etc.). MTH, DAY, and YR are all numeric >values that, when sorted by YR, then MTH, then DAY in Excel, give me the >order that I want (Will To Power #1 first, Will to Power #12 last). >When I sort the same way using WebCat (below), I get a seemingly random >order (#6, #8, #5, #9, ...) The sorted order doesn't even match the order >of records in the database. >[SEARCH >db=DB/Test.db&bwtitledata=Will&allhit=1&YRsort=1&MTHsort=2&DAYsort=3&YRtype=num&MTHtype=num&DAYtype=num] [founditems][TITLE] ([MTH]/[DAY]/[YR])
[/FOUNDITEMS] >[/SEARCH]I can see the same problem here. I'm not sure what's going on, but if you'd like to work around it in the meantime, try replacing all the 1-digit values in the MTH and DAY fields with 2-digit values (so that '2' becomes '02' -- you can do a replace that searches for values less than 10 and replaces them with '0[mth]' or '0[day]'). Remove the '&MTHtype=num&DAYtype=num' parameters from your search and everthing should sort correctly. If you want the output to look like '2/8/1997', just change the text in the [founditems] context to ([math][MTH][/math]/[math][DAY][/math]/[YR]).Hope this helps for now,Marc Eagle StarNine Technologies http://www.smithmicro.com/ Marc Eagle

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:Searching for ALL / empty form field *the FINAL answer* (1997) Working HTML email (2001) Re:no template caching (1997) WebCat2b15MacPlugin - [protect] (1997) Using WebCat for product info requests (1997) 2nd try:Webcat interfering with Webstar? (1998) [Replace] really replaces? (2000) Emailer (1997) webcatalog approaching max (1998) WebCatalog [FoundItems] Problem - LONG - (1997) Email Tracking (2004) SQL Query Question (2001) Email (1998) Limiting user access to .tmpl files (1997) protect tag on NT IIS (1997) [WebDNA] Yosemite (2014) Summing fields (1997) PROBLEM (1997) Cookie Crumble (1998) PIXO support (1997)