Re: [lookup] is case-sensitive, [lookup] is case sensitive...

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 50895
interpreted = N
texte = Thanks, Ken, I will try all of your suggestions. -DanOn Wed, 4 Jun 2003 00:07:36 Kenneth Grome wrote: >>I spoke too soon....Anybody see any syntax errors with the following code? My brain hurts. >> >>------------------------------------------------------------------------------------------------- >>[format .2f][math][payment_gross]-([lookup >>db=IPN.db&lookinfield=INVOICE&value=[invoice]&returnfield=CPG_subtotal]+[tax]+[payment_fee])[/math][/format] >>------------------------------------------------------------------------------------------------- > > > > From what I recall, the only parameter in a lookup that's case >sensitive is the value parameter. > >In your code above, a problem may arise if the value in the CPG_subtotal field is not a number, >or if the [payment_gross] or [tax] or [payment_fee] values are not all numbers, because then the >math won't work, and that will cause the format to fail as well. > >You may want to use the notfound=0 parameter in the lookup to insure that if the lookup fails, >the resulting value will be a number instead of null. Of course this will not help if any other >variable value mentioned above is not numeric. > >Check all the variable values to make sure they are all numbers before giving up. Oh, and you >really do not need the parentheses in the expression in the math context ... :) >-- > >Sincerely, >Kenneth Grome >------------------------------------------------------------- >My programmers write WebDNA code at $18 an hour or less! >------------------------------------------------------------- > >------------------------------------------------------------- >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/------------------------------------------------------------ http://www.StrongGraphicDesign.com (208) 319-0137 | Toll-free p/f 877-561-1656 ------------------------------------------------------------------------------------------------------------------------- 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: [lookup] is case-sensitive, [lookup] is case sensitive... (Dan Strong 2003)
  2. Re: [lookup] is case-sensitive, [lookup] is case sensitive... (Kenneth Grome 2003)
  3. Re: [lookup] is case-sensitive, [lookup] is case sensitive... (Dan Strong 2003)
  4. Re: [lookup] is case-sensitive, [lookup] is case sensitive... (WebCat @ Inkblot Media 2003)
  5. Re: [lookup] is case-sensitive, [lookup] is case sensitive... (WJ Starck 2003)
  6. Re: [lookup] is case-sensitive, [lookup] is case sensitive... (Dan Strong 2003)
  7. [lookup] is case-sensitive, [lookup] is case sensitive... (Dan Strong 2003)
Thanks, Ken, I will try all of your suggestions. -DanOn Wed, 4 Jun 2003 00:07:36 Kenneth Grome wrote: >>I spoke too soon....Anybody see any syntax errors with the following code? My brain hurts. >> >>------------------------------------------------------------------------------------------------- >>[format .2f][math][payment_gross]-([lookup >>db=IPN.db&lookinfield=INVOICE&value=[invoice]&returnfield=CPG_subtotal]+[tax]+[payment_fee])[/math][/format] >>------------------------------------------------------------------------------------------------- > > > > From what I recall, the only parameter in a lookup that's case >sensitive is the value parameter. > >In your code above, a problem may arise if the value in the CPG_subtotal field is not a number, >or if the [payment_gross] or [tax] or [payment_fee] values are not all numbers, because then the >math won't work, and that will cause the format to fail as well. > >You may want to use the notfound=0 parameter in the lookup to insure that if the lookup fails, >the resulting value will be a number instead of null. Of course this will not help if any other >variable value mentioned above is not numeric. > >Check all the variable values to make sure they are all numbers before giving up. Oh, and you >really do not need the parentheses in the expression in the math context ... :) >-- > >Sincerely, >Kenneth Grome >------------------------------------------------------------- >My programmers write WebDNA code at $18 an hour or less! >------------------------------------------------------------- > >------------------------------------------------------------- >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/------------------------------------------------------------ http://www.StrongGraphicDesign.com (208) 319-0137 | Toll-free p/f 877-561-1656 ------------------------------------------------------------------------------------------------------------------------- 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/ Dan Strong

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:

totals (1997) multi condition with showif (2005) Adding up line items. (2000) Summing fields (1997) Banners (1997) math on date? (1997) RE: New WebCatalog Version !!! (1997) Multiple Pulldowns (1997) all records returned. (1997) Does summarizing found records require sorting on that samefield? (1999) Re:E-Mailer (WebCatb15acgiMac) (1997) WebCat2 beta FTP site (1997) Help name our technology! (1997) This list needs a digest: rant, rave... (1997) Snake Bites (1997) [WebDNA] Can't see were it's wrong.... (2017) docs for WebCatalog2 (1997) sBox (2002) [WebDNA] WebDNA7 config help (2012) search/results scripting (2000)