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:
Security (1998)
How to Sort Summ data ? (1997)
Web Catalog 2 demo (1997)
Multi Actions (1999)
Instructions for Digest (1997)
Negative Range Error (2003)
Re1000001: Setting up shop (1997)
European dates (1998)
Subtotal Not Calculated on Invoice.html (1998)
docs for WebCatalog2 (1997)
Newbie from and old bee (1997)
Conveting Characters to Graphics (1997)
RePost: NAT and the CART (1999)
RE: Loss in form (1998)
Restart of DBserver (1997)
hideif glitch (2003)
[OT] Communigate List (2003)
Problem 2: Prefs file... (1997)
WC Database Format (1997)
What is a TAB (2003)