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:

List Address Changed! (1998) [WebDNA] GREP Question (2009) jpeg upload compression (fixed) (2002) Before I Can Begin . . . (1998) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) PCS Emailer's role ? (1997) includes (2003) Great product and great job ! (1997) WebCat2.0 acgi vs plugin (1997) Document Contains No Data msg (1997) Closing Databases (1998) 'does not contain' operator needed ... (1997) FTP FOLDER PERMISSIONS (2004) PR: WebCatalog Affiliates Program Announced -- Share the revenue for promoting WebCatalog (2000) Re:Change WebDNA-Talk Mail due to no digest for 1wk (1997) Sorting error (1997) Help with Repost Data msg from form (1997) multiple product databases (1997) Adding order weight (1999) [addlineitems] display (1997)