Re: [WebDNA] Searching using variable or numeric number

This WebDNA talk-list message is from

2019


It keeps the original formatting.
numero = 114513
interpreted = N
texte = 2132 I should have mentioned that the data in the DB is a 13-digit number and = not a native cart value. This makes a difference when analysing the = codes purpose and goal. Anyhow, I get the point and thank you to all who chipped in as I have a = running solution now. /Palle > On 15 Mar 2019, at 15.21, Brian Fries wrote: >=20 > Palle - >=20 > My point on the numeric caparison is if you compare >=20 > This: 1550000000000123456 to > This: 1559999999999 >=20 > The first is greater as a NUM, but the second is greater as TEXT >=20 > So every record with more than 13 digits in the cart value in your = database will be in your found set, since you are comparing it to at 13 = digit number. >=20 > Hope this helps=E2=80=A6 >=20 > - Brian >=20 >> On Mar 15, 2019, at 12:24 AM, Hetzner Powerpalle = wrote: >>=20 >> Thanks Kenn >>=20 >> I guess I could use the following to convert it from a string to a = number=E2=80=A6 >>=20 >> [text]example_variable=3D[cart][/text] >>=20 >> =E2=80=A6and then define it as type=3Dnum in a search context. >>=20 >> /Palle >>=20 >>=20 >>> On 14 Mar 2019, at 13.50, WebDNA Solutions = wrote: >>>=20 >>> It's because [cart] creates a string of characters, not a number. >>>=20 >>>=20 >>> Regards, >>> Kenneth Grome >>> WebDNA Solutions >>> http://www.webdnasolutions.com >>> Urgent/Emergency Phone: (228) 222-2917 >>> Web Database Systems and Linux Server Administration >>>=20 >>>=20 >>>=20 >>>> Hi Brian >>>>=20 >>>> I found the solution as described in my previous mail =E2=80=A6 but = thanks for >>>> your input. >>>>=20 >>>> What I do not undestand is your recommendation to remove the = type=3Dnum. >>>> It is my understanding that trying to do a calculation or = comparison >>>> of two numbers (in this case something which is numerically = greater), >>>> it is best to define the variables as numbers hense, type=3Dnum. Is = it >>>> because defining type=3Dnum is only working with a value for 13 >>>> characters and/or less? >>>>=20 >>>> /Palle >>>>=20 >>>>=20 >>>>=20 >>>>> On 14 Mar 2019, at 00.31, Brian Fries wrote: >>>>>=20 >>>>> 1 - you=E2=80=99ve truncated the cart value to 13 characters in = calculating >>>>> scope_threshold 2 - you=E2=80=99re doing a type=3Dnum comparison, = when the >>>>> value in your database may have more than 13 characters >>>>>=20 >>>>> So, looking for values greater than 1552493728968 will find >>>>> everything that has 14 or more digits, because they are = numerically >>>>> greater >>>>>=20 >>>>> Try without the type=3Dnum parameter in your search. >>>>>=20 >>>>> - Brian F >>>>>=20 >>>>>> On Mar 13, 2019, at 9:42 AM, Hetzner Powerpalle >>>>>> wrote: >>>>>>=20 >>>>>> Why does this NOT provide me with a result, when using >>>>>>=20 >>>>>> gedb3_indexdata=3D[scope_threshold] >>>>>>=20 >>>>>> While it gives me a result when this works, just using a plain >>>>>> number (same value as in the variable) >>>>>>=20 >>>>>> gedb3_indexdata=3D1552493728968 >>>>>>=20 >>>>>> Purpose is to find all matching records which are newer (has a >>>>>> higher number/value) than [scope_threshold] >>>>>>=20 >>>>>> =E2=80=94=E2=80=94 taken from this code =E2=80=94=E2=80=94 >>>>>>=20 >>>>>> [text show=3Dt]scope_days=3D14[/text] >>>>>> [text show=3Dt]scope_sum=3D[math]86400*[scope_days][/math][/text] >>>>>> [text show=3Dt]scope_threshold=3D[math][format 13s][cart] >>>>>> [/format]-[scope_sum][/math][/text] >>>>>>=20 >>>>>> =09 >>>>>> [search >>>>>> = db=3D/forum/db/db3.db&gedb3_indexdata=3D[scope_threshold]&db3_indextype=3D= num&AllReqd=3DT&max=3D5&dedb3_thread_readsort=3D1&db3_thread_readtype=3Dnu= m]=20 >>>>>> [founditems] >>>>>>=20 >>>>>> [/founditems] [/search] >>>>>>=20 >>>>>> =E2=80=94=E2=80=94 SNIP =E2=80=94=E2=80=94 >>>>>>=20 >>>>>> /Palle--------------------------------------------------------- >>>>>> This message is sent to you because you are subscribed to >>>>>> the mailing list talk@webdna.us >>>>>> To unsubscribe, E-mail to: talk-leave@webdna.us >>>>>> archives: http://www.webdna.us/page.dna?numero=3D55 >>>>>> Bug Reporting: support@webdna.us >>>>>=20 >>>>> --------------------------------------------------------- >>>>> This message is sent to you because you are subscribed to >>>>> the mailing list talk@webdna.us >>>>> To unsubscribe, E-mail to: talk-leave@webdna.us >>>>> archives: http://www.webdna.us/page.dna?numero=3D55 >>>>> Bug Reporting: support@webdna.us >>>>=20 >>>> --------------------------------------------------------- >>>> This message is sent to you because you are subscribed to >>>> the mailing list talk@webdna.us >>>> To unsubscribe, E-mail to: talk-leave@webdna.us >>>> archives: http://www.webdna.us/page.dna?numero=3D55 >>>> Bug Reporting: support@webdna.us >>> --------------------------------------------------------- >>> This message is sent to you because you are subscribed to >>> the mailing list talk@webdna.us >>> To unsubscribe, E-mail to: talk-leave@webdna.us >>> archives: http://www.webdna.us/page.dna?numero=3D55 >>> Bug Reporting: support@webdna.us >>=20 >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list talk@webdna.us >> To unsubscribe, E-mail to: talk-leave@webdna.us >> archives: http://www.webdna.us/page.dna?numero=3D55 >> Bug Reporting: support@webdna.us >=20 > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list talk@webdna.us > To unsubscribe, E-mail to: talk-leave@webdna.us > archives: http://www.webdna.us/page.dna?numero=3D55 > Bug Reporting: support@webdna.us --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us . Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Searching using variable or numeric number (Hetzner Powerpalle 2019)
  2. Re: [WebDNA] Searching using variable or numeric number (Brian Fries 2019)
  3. Re: [WebDNA] Searching using variable or numeric number (Hetzner Powerpalle 2019)
  4. Re: [WebDNA] Searching using variable or numeric number (WebDNA Solutions 2019)
  5. Re: [WebDNA] Searching using variable or numeric number (Hetzner Powerpalle 2019)
  6. Re: [WebDNA] Searching using variable or numeric number (Brian Fries 2019)
  7. [WebDNA] Searching using variable or numeric number (Hetzner Powerpalle 2019)
2132 I should have mentioned that the data in the DB is a 13-digit number and = not a native cart value. This makes a difference when analysing the = codes purpose and goal. Anyhow, I get the point and thank you to all who chipped in as I have a = running solution now. /Palle > On 15 Mar 2019, at 15.21, Brian Fries wrote: >=20 > Palle - >=20 > My point on the numeric caparison is if you compare >=20 > This: 1550000000000123456 to > This: 1559999999999 >=20 > The first is greater as a NUM, but the second is greater as TEXT >=20 > So every record with more than 13 digits in the cart value in your = database will be in your found set, since you are comparing it to at 13 = digit number. >=20 > Hope this helps=E2=80=A6 >=20 > - Brian >=20 >> On Mar 15, 2019, at 12:24 AM, Hetzner Powerpalle = wrote: >>=20 >> Thanks Kenn >>=20 >> I guess I could use the following to convert it from a string to a = number=E2=80=A6 >>=20 >> [text]example_variable=3D[cart][/text] >>=20 >> =E2=80=A6and then define it as type=3Dnum in a search context. >>=20 >> /Palle >>=20 >>=20 >>> On 14 Mar 2019, at 13.50, WebDNA Solutions = wrote: >>>=20 >>> It's because [cart] creates a string of characters, not a number. >>>=20 >>>=20 >>> Regards, >>> Kenneth Grome >>> WebDNA Solutions >>> http://www.webdnasolutions.com >>> Urgent/Emergency Phone: (228) 222-2917 >>> Web Database Systems and Linux Server Administration >>>=20 >>>=20 >>>=20 >>>> Hi Brian >>>>=20 >>>> I found the solution as described in my previous mail =E2=80=A6 but = thanks for >>>> your input. >>>>=20 >>>> What I do not undestand is your recommendation to remove the = type=3Dnum. >>>> It is my understanding that trying to do a calculation or = comparison >>>> of two numbers (in this case something which is numerically = greater), >>>> it is best to define the variables as numbers hense, type=3Dnum. Is = it >>>> because defining type=3Dnum is only working with a value for 13 >>>> characters and/or less? >>>>=20 >>>> /Palle >>>>=20 >>>>=20 >>>>=20 >>>>> On 14 Mar 2019, at 00.31, Brian Fries wrote: >>>>>=20 >>>>> 1 - you=E2=80=99ve truncated the cart value to 13 characters in = calculating >>>>> scope_threshold 2 - you=E2=80=99re doing a type=3Dnum comparison, = when the >>>>> value in your database may have more than 13 characters >>>>>=20 >>>>> So, looking for values greater than 1552493728968 will find >>>>> everything that has 14 or more digits, because they are = numerically >>>>> greater >>>>>=20 >>>>> Try without the type=3Dnum parameter in your search. >>>>>=20 >>>>> - Brian F >>>>>=20 >>>>>> On Mar 13, 2019, at 9:42 AM, Hetzner Powerpalle >>>>>> wrote: >>>>>>=20 >>>>>> Why does this NOT provide me with a result, when using >>>>>>=20 >>>>>> gedb3_indexdata=3D[scope_threshold] >>>>>>=20 >>>>>> While it gives me a result when this works, just using a plain >>>>>> number (same value as in the variable) >>>>>>=20 >>>>>> gedb3_indexdata=3D1552493728968 >>>>>>=20 >>>>>> Purpose is to find all matching records which are newer (has a >>>>>> higher number/value) than [scope_threshold] >>>>>>=20 >>>>>> =E2=80=94=E2=80=94 taken from this code =E2=80=94=E2=80=94 >>>>>>=20 >>>>>> [text show=3Dt]scope_days=3D14[/text] >>>>>> [text show=3Dt]scope_sum=3D[math]86400*[scope_days][/math][/text] >>>>>> [text show=3Dt]scope_threshold=3D[math][format 13s][cart] >>>>>> [/format]-[scope_sum][/math][/text] >>>>>>=20 >>>>>> =09 >>>>>> [search >>>>>> = db=3D/forum/db/db3.db&gedb3_indexdata=3D[scope_threshold]&db3_indextype=3D= num&AllReqd=3DT&max=3D5&dedb3_thread_readsort=3D1&db3_thread_readtype=3Dnu= m]=20 >>>>>> [founditems] >>>>>>=20 >>>>>> [/founditems] [/search] >>>>>>=20 >>>>>> =E2=80=94=E2=80=94 SNIP =E2=80=94=E2=80=94 >>>>>>=20 >>>>>> /Palle--------------------------------------------------------- >>>>>> This message is sent to you because you are subscribed to >>>>>> the mailing list talk@webdna.us >>>>>> To unsubscribe, E-mail to: talk-leave@webdna.us >>>>>> archives: http://www.webdna.us/page.dna?numero=3D55 >>>>>> Bug Reporting: support@webdna.us >>>>>=20 >>>>> --------------------------------------------------------- >>>>> This message is sent to you because you are subscribed to >>>>> the mailing list talk@webdna.us >>>>> To unsubscribe, E-mail to: talk-leave@webdna.us >>>>> archives: http://www.webdna.us/page.dna?numero=3D55 >>>>> Bug Reporting: support@webdna.us >>>>=20 >>>> --------------------------------------------------------- >>>> This message is sent to you because you are subscribed to >>>> the mailing list talk@webdna.us >>>> To unsubscribe, E-mail to: talk-leave@webdna.us >>>> archives: http://www.webdna.us/page.dna?numero=3D55 >>>> Bug Reporting: support@webdna.us >>> --------------------------------------------------------- >>> This message is sent to you because you are subscribed to >>> the mailing list talk@webdna.us >>> To unsubscribe, E-mail to: talk-leave@webdna.us >>> archives: http://www.webdna.us/page.dna?numero=3D55 >>> Bug Reporting: support@webdna.us >>=20 >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list talk@webdna.us >> To unsubscribe, E-mail to: talk-leave@webdna.us >> archives: http://www.webdna.us/page.dna?numero=3D55 >> Bug Reporting: support@webdna.us >=20 > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list talk@webdna.us > To unsubscribe, E-mail to: talk-leave@webdna.us > archives: http://www.webdna.us/page.dna?numero=3D55 > Bug Reporting: support@webdna.us --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us . Hetzner Powerpalle

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:

multi-paragraph fields (1997) this year (2000) Shiping problem (1999) re: [addlineitem] working almost (1997) WCS Newbie question (1997) Here we go again... (2006) VCF Card (1998) Another question (1997) Satisfy Me ! was: Why can't support be satisfying to (2000) Payment Processors (2005) New command suggestion (1997) [isfile] ? (1997) Emailer (WebCat2) (1997) [WebDNA] Crontab to execute DNA (2012) Admin Section (2002) Possible Bug in 2.0b15.acgi (1997) Server replication (1998) Reversing [ipaddress] normalization (1998) ShowIf variables (1997) Re:WebCatalog 3 for Macintosh (1998)