Re: Dates and Math - Simple Subtraction

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 58885
interpreted = N
texte = I step 3), you use a variable named [THREEWEEK] - your previous steps created the [TWOWEEK] variable. You should be able to simplify this into one easy step: [text]SOLDDATE=[math date]{[date]}-14[/math][/text] The {[date]} results in a number (days since the year 0000), from which you can simply subtract 14 days. The [math date] turns that number back into a human-formatted date (using you preferences settings). - brian On Jul 26, 2004, at 2:12 PM, David Cate wrote: > Hello, > > I'm trying to only show records that exist within the past two weeks. > If an item was sold more than two weeks ago, we don't want to display > the record. > > Can someone tell me where I've gone wrong? > > 1. Define [TODAY[ > [text]TODAY=[date %m/%d/%y][/text] > (Note: Database already carries 00/00/00 value) - Number turns out fine > > 2. Define two week value > [text]TWOWEEK=[Math]{[TODAY]}-{00/14/00}[/Math][/text] > (This seems to be the problem - This turns out a number 34870 - not > sure how that happened. > > 3. Format TWO WEEK to var [SOLDDATE] > [text]SOLDDATE=[format days_to_date > %m/%d/%y][THREEWEEK][/format][/text] > (value turns out 00/00/00) > > Here's the search query...which obviously does not work. Anyone have > any suggestions for anything for me look at? > [search > db=admin/cars- > n.db&geSTOCKdata=[blank]&geSolddata=[SOLDDATE]&SOLDtype=date] > > Thanks in advance. > -- Brian Fries, BrainScan Software -- http://www.brainscansoftware.com -- ------------------------------------------------------------- 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: Dates and Math - Simple Subtraction ( Brian Fries 2004)
  2. Re: Dates and Math - Simple Subtraction ( David Cate 2004)
  3. Re: Dates and Math - Simple Subtraction ( "Gary Krockover" 2004)
  4. Re: Dates and Math - Simple Subtraction ( Brian Fries 2004)
  5. Re: Dates and Math - Simple Subtraction ( David Cate 2004)
  6. Re: Dates and Math - Simple Subtraction ( Brian Fries 2004)
  7. Dates and Math - Simple Subtraction ( David Cate 2004)
I step 3), you use a variable named [THREEWEEK] - your previous steps created the [TWOWEEK] variable. You should be able to simplify this into one easy step: [text]SOLDDATE=[math date]{[date]}-14[/math][/text] The {[date]} results in a number (days since the year 0000), from which you can simply subtract 14 days. The [math date] turns that number back into a human-formatted date (using you preferences settings). - brian On Jul 26, 2004, at 2:12 PM, David Cate wrote: > Hello, > > I'm trying to only show records that exist within the past two weeks. > If an item was sold more than two weeks ago, we don't want to display > the record. > > Can someone tell me where I've gone wrong? > > 1. Define [TODAY[ > [text]TODAY=[date %m/%d/%y][/text] > (Note: Database already carries 00/00/00 value) - Number turns out fine > > 2. Define two week value > [text]TWOWEEK=[math]{[TODAY]}-{00/14/00}[/Math][/text] > (This seems to be the problem - This turns out a number 34870 - not > sure how that happened. > > 3. Format TWO WEEK to var [SOLDDATE] > [text]SOLDDATE=[format days_to_date > %m/%d/%y][THREEWEEK][/format][/text] > (value turns out 00/00/00) > > Here's the search query...which obviously does not work. Anyone have > any suggestions for anything for me look at? > [search > db=admin/cars- > n.db&geSTOCKdata=[blank]&geSolddata=[SOLDDATE]&SOLDtype=date] > > Thanks in advance. > -- Brian Fries, BrainScan Software -- http://www.brainscansoftware.com -- ------------------------------------------------------------- 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/ Brian Fries

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:

really wierd browser truncating (1997) WebDNA 4.5 upgrade? (2002) There's a bug in the math context ... (1997) Some Questions (1997) Wanted: More Math Functions (or, Can You Solve This?) (1997) NT 4.02b5 Order Lineitems bug. (2000) Country & Ship-to address & other fields ? (1997) [listfiles] nested in a [loop] (1998) browser info.txt and SSL (1997) [WebDNA] Strange error (2014) pop up menu's (1998) Server crashes when user saves or views html source (1998) Weird cart problem (webcat 2.x) (2000) [math] show=F exists? (1997) WebCatalog-NT?'s (1996) Will webdna execute before a [redirect]? (1999) Sku numbers (1997) .. more on sliding discounts... (1997) What am I missing (1997) Bug with sendmail under RedHat (2006)