Looking up two prices in database?

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 12573
interpreted = N
texte = Hello All,I need some help looking up two prices in my database.This is the situation. My customer sells his products either at full price, or at a sale price. Both prices are in the database which contains nearly 15,000 records. ( Imention this because using multiple databases to solve this problem is probably not an option.) There is also a field onsale which is set to either T or F. What I had thought to do was look in the database to check if a product was on sale (onsale=T0 and set the price accordingly.I have tried a modification of a formula that is in the online docs.price [math][showif [onsale]=T][saleprice][/showif][lookup db=products.db&lookInField=SKU&value=[SKU]&returnField=price][/math]I have two search methods.To search for the onsale items is am using a hypertext link like thisClick here to see our in-house specials.It successfully returns the items where onsale=T and displays the price of the first item as 2.73 which is its regular price and a price of 5.00 for the second item the price of which is actually 5.33.The second search is triggered from a form and finds items by the product, category, price, etc.. It finds all the products searched for successfully, including those where onsale=T. Here's the wierd part. The prices of the two items for which onsale=T are displayed as 2.73 and 5.33, the correct prices from the database.The results pages for the two searches are IDENTICAL. I simply did a save as to create the SaleResults.tmpl template as a duplicate of the Results.tmpl template.Therefore, I have two questions.1. How do I get WebCatalog to look up and display the saleprice when onsale=T and the regular price when onsale=F? OR is there a better way to do this.2. Why does WebCatalog display the prices differently in identical results.tmpl templates?This is the last hurdle I must overcome to get this site up live. Everything else is working just as I had hoped.Thanks for any help you can provide.Jerry Nielsen - commSTRUCT Associates Associated Messages, from the most recent to the oldest:

    
  1. Re: Looking up two prices in database? (Grant Hulbert 1997)
  2. Re: Looking up two prices in database? ( 1997)
  3. Re: Looking up two prices in database? (Grant Hulbert 1997)
  4. Re: Looking up two prices in database? ( 1997)
  5. Re: Looking up two prices in database? (Grant Hulbert 1997)
  6. Looking up two prices in database? ( 1997)
Hello All,I need some help looking up two prices in my database.This is the situation. My customer sells his products either at full price, or at a sale price. Both prices are in the database which contains nearly 15,000 records. ( Imention this because using multiple databases to solve this problem is probably not an option.) There is also a field onsale which is set to either T or F. What I had thought to do was look in the database to check if a product was on sale (onsale=T0 and set the price accordingly.I have tried a modification of a formula that is in the online docs.price [math][showif [onsale]=T][saleprice][/showif][lookup db=products.db&lookInField=SKU&value=[SKU]&returnField=price][/math]I have two search methods.To search for the onsale items is am using a hypertext link like thisClick [cart]&eqonsaledat a=T>here to see our in-house specials.It successfully returns the items where onsale=T and displays the price of the first item as 2.73 which is its regular price and a price of 5.00 for the second item the price of which is actually 5.33.The second search is triggered from a form and finds items by the product, category, price, etc.. It finds all the products searched for successfully, including those where onsale=T. Here's the wierd part. The prices of the two items for which onsale=T are displayed as 2.73 and 5.33, the correct prices from the database.The results pages for the two searches are IDENTICAL. I simply did a save as to create the SaleResults.tmpl template as a duplicate of the Results.tmpl template.Therefore, I have two questions.1. How do I get WebCatalog to look up and display the saleprice when onsale=T and the regular price when onsale=F? OR is there a better way to do this.2. Why does WebCatalog display the prices differently in identical results.tmpl templates?This is the last hurdle I must overcome to get this site up live. Everything else is working just as I had hoped.Thanks for any help you can provide.Jerry Nielsen - commSTRUCT Associates

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:

Problems reading files created by WC (1997) What about the fixes that were promised for 5.2 ? (2004) SandBox and ImageMagick (2003) WCS Newbie question (1997) UPDATE PROBLEM (1997) [WebDNA] Some code inside a large loops fail ... but why? (2010) emailer w/F2 (1997) carriage returns in data (1997) Part Html part WebDNA (1997) TemplateCacheSize preference! (1998) Why do extra quotation marks sometimes appear in my databases? (1998) Format date.... (2003) authenticating a second user (1997) No Wanna Duppys (1998) Reversing [ipaddress] normalization (1998) Execute Applescript (1997) international time (1997) Browser compatibility (Was: Search Engine bots) (2002) WebCat2b15MacPlugIn - [authenticate] not [protect] (1997) downloading binary files ussing mime and tcpconnect (2004)