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:

WebCat Code and WebStar Search? (2000) Disappearing data (2002) multi-paragraph fields (1997) Dummy Credit Card Number for debug? (1997) Separate SSL Server (1997) WebCAT 3.x (2002) Multiple Newcarts (1996) Hello??? (1997) Faxing orders in place of email (1997) groups and [ShowNext] (1997) Great product and great job ! (1997) Almost a there but..bye bye NetCloak (1997) Sort Order on a page search (1997) refreshing IE with posted .tmpl (1997) Free WebDNA snippets (Extending WebCatalog) (1997) [AppendFile] problem (WebCat2b13 Mac .acgi) (1997) Explorer 3.0 (1997) Javascript Stored in a Database (2003) I'm a Fool! -- Was -> RE: Convert Chars Issue? (2000) Problem with summary on date / inconsequent webcat behaviour (1998)