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:

(2000) Re:my First Ship table (1998) Re2: AAgghh!! Help, please. SSL strikes again. (1997) Error:Too many nested [xxx] contexts (1997) multi-paragraph fields (1997) [WebDNA] Listfiles and sort order (2010) not interpreting Q (2001) Pithy questions on webcommerce & siteedit (1997) WebDNAMonitor (2002) ServerQuestion (2000) Problems with dbcatalog.exe (1997) ooops...WebCatalog [FoundItems] Problem - LONG - (1997) searching for items that begin with a number (2004) Nested vs conditional (1997) AddlineItem (2000) test (2000) searchable list archive (1997) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) Not really WebCat (1997) PCS Emailer's role ? (1997)