Re: Date summarising
This WebDNA talk-list message is from 2005
It keeps the original formatting.
numero = 62685
interpreted = N
texte = Steve Craig wrote:> Etc etc, hopefully you get the idea. The dates are stored as dd/mm/yyyy in> the db. I just can't get my head round how to summarise the date variable> into blocks of months, if that makes sense.The easiest thing to do is to make a one-time adjustment to the database to store the year, month, and day in seperate columns. Whether you make this in addition to the existing column or as a replacement depends on how many templates update this field.However, I'm assuming that you are currently storing the date value as a number, not as a string (since you cannot sort by date with a string that is not in ISO format, e.g. [CC]YY/MM/DD). You could also return the records in date order and then use the [founditems] loop to print out the Month header iff it is not the same as the last one you printed out. Something like this (not tested):[text show=f]thismonth=[/text][!]will be set in the loop[/!][search ....in date order...][founditems][if "[thismonth]" ! "[format Days_To_Date %B %Y][datefield][/format]"][then] [text show=t]thismonth=[format Days_To_Date %B %Y][datefield][/format][/text][/then][/if]....If you want any HTML formatting for the month lines, include that wrapped around the second [text] tag (I'm thinking things line
).HTHJohn-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4720 Boston WayLanham, MD 20706301-459-3366 x.5010fax 301-429-5747-------------------------------------------------------------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:
Steve Craig wrote:> Etc etc, hopefully you get the idea. The dates are stored as dd/mm/yyyy in> the db. I just can't get my head round how to summarise the date variable> into blocks of months, if that makes sense.The easiest thing to do is to make a one-time adjustment to the database to store the year, month, and day in seperate columns. Whether you make this in addition to the existing column or as a replacement depends on how many templates update this field.However, I'm assuming that you are currently storing the date value as a number, not as a string (since you cannot sort by date with a string that is not in ISO format, e.g. [CC]YY/MM/DD). You could also return the records in date order and then use the [founditems] loop to print out the Month header iff it is not the same as the last one you printed out. Something like this (not tested):[text show=f]thismonth=[/text][!]will be set in the loop[/!][search ....in date order...][founditems][if "[thismonth]" ! "[format Days_To_Date %B %Y][datefield][/format]"][then] [text show=t]thismonth=[format Days_To_Date %B %Y][datefield][/format][/text][/then][/if]....If you want any HTML formatting for the month lines, include that wrapped around the second [text] tag (I'm thinking things line ).HTHJohn-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4720 Boston WayLanham, MD 20706301-459-3366 x.5010fax 301-429-5747-------------------------------------------------------------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/
John Peacock
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:
Exclamation point (1997)
[ot] iBook vs. 12" PB (2004)
no global [username] or [password] displayed ... (1997)
taxrate - off by 1 cent (1997)
Almost a there but..bye bye NetCloak (1997)
[SearchString] problem with [search] context (1997)
WebCatalog NT beta 18 problem (1997)
Spamming this list! (2000)
We are searching (2005)
[WebDNA] variable name limit - clarification (2009)
Multiple catalog databases and showcart (1997)
unable to launch acgi in WebCat (1997)
MacAuthorize order data fields WAS:How To question... (1997)
Mac: LModelDirector bug fix (1997)
WebDNA maxing out processor (2008)
Stinkin' [Referrer] (1998)
notification solutions (1997)
ShowNext Command (1997)
Configuring E-mail (1997)
Close Databases Crash? (1998)
| |