Re: Showif date range comparison

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 24081
interpreted = N
texte = I ran into a similar problem when trying to add a markup to my shipping cost depending on the weight of a product. So basically I was trying to do something like this:[showif [weight] is greater than or equal to 1 pound AND [weight] is less than or equal to 5 pounds][math] [shipCost]+1[/math] [/showif]So if the weight was 4 pounds it would show [math][shipCost]+1[/math]I ended up doing something like this: [showif [weight]>0][showif [weight]<6]mark up 1 dollar[/showif][/showif] [showif [weight]>5][showif [weight]<10]mark up 2 dollars[/showif][/showif] [showif [weight]>10][showif [weight]<20]mark up 4 dollars[/showif][/showif] [showif [weight]>20][showif [weight]<50]mark up 6 dollars[/showif][/showif]So if the weight=30 pounds it would show mark up 6 dollarsThis seems to work. I'm not sure if this helps your dilema or not but there ya go. Working with ranges gives me a headache :)BrantBen Weinberg wrote:> I have set up a table with the heading cells set to show dates starting with > 1/1/99 and incrementing by 7 days per cell. > > There is a varable in each item record that is formatted as a date. > > I want to use the showif context to display some data in the record if the > date variable is between date1 and date2 . . . but can't get the comparison > to work. > > [math date] week1={01/01/1999}[/math] > [format days_to_date %m/%d/%Y][math] > week2=[week1]+7[/math][/format] > (and so on) > > > [showif [Shipdate]ge[week1]][Minutes][/showif] > > My above comparison is just testing one week and it doesn't work. The > manual isn't clear on the way to set this up. Can it be done? > > Ben Weinberg > ben@pca.com Associated Messages, from the most recent to the oldest:

    
  1. Re: Showif date range comparison (Kenneth Grome 1999)
  2. Re: Showif date range comparison (es-sleestak 1999)
  3. Re: Showif date range comparison (Ben Weinberg 1999)
  4. Re: Showif date range comparison (Kenneth Grome 1999)
  5. Re: Showif date range comparison (Ben Weinberg 1999)
  6. Re: Showif date range comparison (John Jakovich 1999)
  7. Showif date range comparison (Ben Weinberg 1999)
I ran into a similar problem when trying to add a markup to my shipping cost depending on the weight of a product. So basically I was trying to do something like this:[showif [weight] is greater than or equal to 1 pound AND [weight] is less than or equal to 5 pounds][math] [shipCost]+1[/math] [/showif]So if the weight was 4 pounds it would show [math][shipCost]+1[/math]I ended up doing something like this: [showif [weight]>0][showif [weight]<6]mark up 1 dollar[/showif][/showif] [showif [weight]>5][showif [weight]<10]mark up 2 dollars[/showif][/showif] [showif [weight]>10][showif [weight]<20]mark up 4 dollars[/showif][/showif] [showif [weight]>20][showif [weight]<50]mark up 6 dollars[/showif][/showif]So if the weight=30 pounds it would show mark up 6 dollarsThis seems to work. I'm not sure if this helps your dilema or not but there ya go. Working with ranges gives me a headache :)BrantBen Weinberg wrote:> I have set up a table with the heading cells set to show dates starting with > 1/1/99 and incrementing by 7 days per cell. > > There is a varable in each item record that is formatted as a date. > > I want to use the showif context to display some data in the record if the > date variable is between date1 and date2 . . . but can't get the comparison > to work. > > [math date] week1={01/01/1999}[/math] > [format days_to_date %m/%d/%Y][math] > week2=[week1]+7[/math][/format] > (and so on) > > > [showif [Shipdate]ge[week1]][Minutes][/showif] > > My above comparison is just testing one week and it doesn't work. The > manual isn't clear on the way to set this up. Can it be done? > > Ben Weinberg > ben@pca.com es-sleestak

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:

Searching multiple dbs (1998) WebCatalog 4.0.2b5 available (2000) Running _every_ page through WebCat ? (1997) WML (2000) Digest for 4/18/97 (1997) autocommit problem (1998) [WebDNA] Suddenly, lots of WebDNA problems with FastCGI (2013) Tax Moratorium Expiring (2001) [addlineitems] display (1997) RE: Formulas.db + Users.db (1997) help needed w/ search params (1998) Storebuilder Seems to have just died (2003) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) protect tag on NT IIS (1997) [WebDNA] Searching for multiple value [search .... 1,2,3] (2015) problems with 2 tags (1997) [WebDNA] Successful, working WebDNA7/CentOS install? (2013) [SHOWIF AND/OR] (1997) webmerchant/ Mac Auth. and CC refunds (1998) Weird Cookie Problem Part 2 (2007)