Re: ANother SHOWIF problem

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 13454
interpreted = N
texte = >In my database, I have divided the on sale date of an item into month >(1-12), day (1-31), and year (01-99) fields (for a number of reasons).What's the name of your on sale date field? You named it date, didn't you? That's the problem ... :)>For some reason, the following code (which is inside a [SEARCH] context) >*always* displays the on sale date. > >[SHOWIF [MATH][DATE][/MATH]<[MATH]{[MTH]/[DAY]/[YR]}[/MATH]]On sale >[MTH]/[DAY]/[YR]
[/SHOWIF]You didn't mention it, but this WebDNA is also located inside a [founditems] context, isn't it? Here's what you're running into ...When WebCat sees a [date] tag inside a [founditems] context, it looks for a field in the database named date, and it uses that value instead of the server date.That's why it is never a good idea to use date as a field name, because eventually you will want to do something exactly like what you're trying to do, and then you will run into the problem you're seeing now - WebCat is using the 'date' value stored in your database instead of the server's date.All you have to do is change the name of your 'date' field to something else - like SaleDate for example. Then when WebCat sees [date] in your WebDNA, it will NOT be able to find a field in your database named date, so it will use the date value from your server instead ... :)Sincerely, Ken Grome WebDNA Solutions http://www.hui.net/dna/webdna.html Associated Messages, from the most recent to the oldest:

    
  1. FW: ANother SHOWIF problem (Marc Eagle 1997)
  2. FW: ANother SHOWIF problem (Marc Eagle 1997)
  3. RE: ANother SHOWIF problem (Michael Winston 1997)
  4. RE: ANother SHOWIF problem (Marc Eagle 1997)
  5. Re: ANother SHOWIF problem (Michael Winston 1997)
  6. Re: ANother SHOWIF problem (Kenneth Grome 1997)
  7. Re: ANother SHOWIF problem (Kenneth Grome 1997)
  8. ANother SHOWIF problem (Michael Winston 1997)
>In my database, I have divided the on sale date of an item into month >(1-12), day (1-31), and year (01-99) fields (for a number of reasons).What's the name of your on sale date field? You named it date, didn't you? That's the problem ... :)>For some reason, the following code (which is inside a [search] context) >*always* displays the on sale date. > >[SHOWIF [math][date][/MATH]<[math]{[MTH]/[DAY]/[YR]}[/MATH]]On sale >[MTH]/[DAY]/[YR]
[/SHOWIF]You didn't mention it, but this WebDNA is also located inside a [founditems] context, isn't it? Here's what you're running into ...When WebCat sees a [date] tag inside a [founditems] context, it looks for a field in the database named date, and it uses that value instead of the server date.That's why it is never a good idea to use date as a field name, because eventually you will want to do something exactly like what you're trying to do, and then you will run into the problem you're seeing now - WebCat is using the 'date' value stored in your database instead of the server's date.All you have to do is change the name of your 'date' field to something else - like SaleDate for example. Then when WebCat sees [date] in your WebDNA, it will NOT be able to find a field in your database named date, so it will use the date value from your server instead ... :)Sincerely, Ken Grome WebDNA Solutions http://www.hui.net/dna/webdna.html Kenneth Grome

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:

SQL 2000 Project (2002) date stamp (2003) Help! WebCat2 bug (1997) [SearchString] usage (1997) middle (2003) Follow-up to listfiles bug report ... (2003) Separate SSL Server (1997) WebCatalog NT (1996) Error -108 (1997) Duplicate Cart Problem in Netscape (2000) Database Options (1997) NT 4.0/IIS WebCat Installation (1998) Multiple catalog databases and showcart (1997) Attention all list readers (1997) cybercash with webcatalog (1999) [Listfiles] vs Netfinder (1997) [WebDNA] [OT] WebDNA Wiki - need grammar check / suggestions (2009) Time to opensource? was [SMSI] WebDNA is too good to (2006) WCS Newbie question (1997) Date Range search (1997)