Re: Summarizing on two fields
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 18356
interpreted = N
texte = Christian, I think you just need to add de to the beginning of the fieldnames you are sorting, as in &decompanysort=1&dedatesort=2. This will forcea sort from newest back to oldest, instead of the default sort order. Also,you will probably need to identify the date field as type date, as in&datetype=date in order for the date sort to function properly. Finally, I am one of those who is of the opinion that you should not have afield in your database called simply date; call it wdate or saledate orsomething other than date so that you don't confuse the heck out of yourselfwhen you also use [date] to set the current date in the database.Per Christian Lied wrote:> I am trying to sort and sum on two fields. One field is a date field, the> other is a field with a company name.> The db contains data for the past 7 days.> Ideally it should contain one line for each company for each day, but in> reality, a few companies is missing every day.> > I wanted to display a search result where I searched the database,> reporting the most current data for every company. I tried something like:> > [search> db=company.db&gecompanydata=[blank]&companysort=1&datesort=2&companysumm=t]> > So essentially I want the result to be summarized by company, but instead> of returning first entry for the company, and thereby the oldest> information, I wanted it to return the most recent entry. But it always> returned the oldest information.> > If I could do this, I would be VERY happy.> > BTW, Ill be offline for 2 weeks now so I will not be able to respond> further until then.> > And, I will once again use the opportunity to thank all you guys on PCS for> excellent and friendly support every time I have contacted you.> > Per Christian Lied> >
> Since I am used to PERL, one thing I really would like to see in a future> WebCat is an equivalent to 'split'.> > > >>Yes you can only summarize one field at a time.> >No, this is not correct.> >> >You can certainly summarize two fields in a search. What sort of results> >were you getting?> >> >John.> >> >> >> > John A. Hill, V.P. Marketing> > Pacific Coast Software> >eCommerce / Web Developer Tools> > http://www.smithmicro.com-- Gil Poulsen, Webmaster*************************************************************** AltiM@c * Phone: (908) 222-9001 ** 111 Mali Drive * FAX: (908) 222-9002 ** North Plainfield, NJ * e-mail: help@altimac.com ** 07062-2355 * WWW: http://www.altimac.com ***************************************************************
Associated Messages, from the most recent to the oldest:
Christian, I think you just need to add de to the beginning of the fieldnames you are sorting, as in &decompanysort=1&dedatesort=2. This will forcea sort from newest back to oldest, instead of the default sort order. Also,you will probably need to identify the date field as type date, as in&datetype=date in order for the date sort to function properly. Finally, I am one of those who is of the opinion that you should not have afield in your database called simply date; call it wdate or saledate orsomething other than date so that you don't confuse the heck out of yourselfwhen you also use
[date] to set the current date in the database.Per Christian Lied wrote:> I am trying to sort and sum on two fields. One field is a date field, the> other is a field with a company name.> The db contains data for the past 7 days.> Ideally it should contain one line for each company for each day, but in> reality, a few companies is missing every day.> > I wanted to display a search result where I searched the database,> reporting the most current data for every company. I tried something like:> > [search> db=company.db&gecompanydata=[blank]&companysort=1&datesort=2&companysumm=t]> > So essentially I want the result to be summarized by company, but instead> of returning first entry for the company, and thereby the oldest> information, I wanted it to return the most recent entry. But it always> returned the oldest information.> > If I could do this, I would be VERY happy.> > BTW, Ill be offline for 2 weeks now so I will not be able to respond> further until then.> > And, I will once again use the opportunity to thank all you guys on PCS for> excellent and friendly support every time I have contacted you.> > Per Christian Lied> >
> Since I am used to PERL, one thing I really would like to see in a future> WebCat is an equivalent to 'split'.> > > >>Yes you can only summarize one field at a time.> >No, this is not correct.> >> >You can certainly summarize two fields in a search. What sort of results> >were you getting?> >> >John.> >> >> >> > John A. Hill, V.P. Marketing> > Pacific Coast Software> >eCommerce / Web Developer Tools> > http://www.smithmicro.com-- Gil Poulsen, Webmaster*************************************************************** AltiM@c * Phone: (908) 222-9001 ** 111 Mali Drive * FAX: (908) 222-9002 ** North Plainfield, NJ * e-mail: help@altimac.com ** 07062-2355 * WWW: http://www.altimac.com ***************************************************************
Gil Poulsen
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:
[replaceChars] would be nice ... (1997)
Nesting format tags (1997)
Mixing and/or in searches (1998)
Summing fields (1997)
[WebDNA] Sandbox Triggers (2008)
File dates in WebCatalog .tmpl/.inc (1997)
default value from Lookup (was Grant, please help me) (1997)
Admin Edit prob. (1997)
Separate SSL Server (1997)
search between two dates (2003)
Expected Behavior? (1999)
building / customizing stores (2000)
[WebDNA] PayPal Express Checkout for WebDNA (2009)
retain raw [cart] submitted value (2004)
unable to launch acgi in WebCat (1997)
Dynamic Exchange Rates (2002)
service stop and restart (1997)
[/application] error? (1997)
Setting up the server (1997)
Spreadsheet App pref. [OT] (2001)