Re: webcat2b12 CGI -- Date comparisons

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 10490
interpreted = N
texte = >(I'm forwarding this from a tech support question so we can talk about it >publicly in case there's something we can all learn from it) >--------------------------- >The following will only find records where the date is equal. It doesn't >find the records where the date is greater than, which is what I expect >with 'ge': > >[Search db=shops.db&modifiedtype=date&gemodifieddata=[format date >%d/%m/%Y][math][convertdate][date >%m/%d/%Y][/convertdate]-604800[/math][/format]&namesort=1] This is why I prefer a standard date format of [%Y/%m/%d] in all the date fields in my databases.Whenever the date is formatted with the time divisions from the largest to the smallest, WebDNA will understand 'gt' or 'ge' or 'lt' or 'le' or 'eq' within a text-only context - no need to tell it you're dealing with a date (as in '&modifiedtype=date').If the date field (in the example here, the user calls it the 'modified' field) were in this format, the following would work:[Search db=shops.db&gemodifieddata=[dateValueFromTheInputForm]&namesort=1]Sincerely, Ken ------------------------------------ To leave this talk list send an email to macjordomo@smithmicro.com with BODY unsubscribe WebDNA-Talk ------------------------------------ Associated Messages, from the most recent to the oldest:

    
  1. Re: webcat2b12 CGI -- Date comparisons (Kenneth Grome 1997)
  2. webcat2b12 CGI -- Date comparisons (Grant Hulbert 1997)
>(I'm forwarding this from a tech support question so we can talk about it >publicly in case there's something we can all learn from it) >--------------------------- >The following will only find records where the date is equal. It doesn't >find the records where the date is greater than, which is what I expect >with 'ge': > >[Search db=shops.db&modifiedtype=date&gemodifieddata=[format date >%d/%m/%Y][math][convertdate][date >%m/%d/%Y][/convertdate]-604800[/math][/format]&namesort=1] This is why I prefer a standard date format of [%Y/%m/%d] in all the date fields in my databases.Whenever the date is formatted with the time divisions from the largest to the smallest, WebDNA will understand 'gt' or 'ge' or 'lt' or 'le' or 'eq' within a text-only context - no need to tell it you're dealing with a date (as in '&modifiedtype=date').If the date field (in the example here, the user calls it the 'modified' field) were in this format, the following would work:[Search db=shops.db&gemodifieddata=[dateValueFromTheInputForm]&namesort=1]Sincerely, Ken ------------------------------------ To leave this Talk List send an email to macjordomo@smithmicro.com with BODY unsubscribe WebDNA-Talk ------------------------------------ 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:

1 cent answer? (1998) format_to_days on NT (1997) Register First (2000) Limiting user access to .tmpl files (1997) breaking words (1997) includes and cart numbers (1997) About the + sign (2002) WEBDNA tags don't process in a .js file (2002) [date] +1 (1999) WebCat editing, SiteGuard & SiteEdit (1997) Email/Sendmail in WEBDNA has stopped... (2004) AOL and webcat (1998) Back Button problems (1998) HTTP header line is too long? (1997) Kaaaaahhhhhhhnnnnnnn! (1997) Re:no template caching (1997) WebCat2b13MacPlugin - [math][date][/math] problem (1997) SSL and WebCatalog (1997) WebCat2: Items xx to xx shown, etc. (1997) Avery 5160 Mailing Labels (2003)