From robson-martins@bol.com.br Thu Jun 13 19:32:09 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id E26F4476F63 for ; Thu, 13 Jun 2002 15:32:09 -0400 (EDT) Received: from studer.bol.com.br (studer.bol.com.br [200.221.24.21]) by postgresql.org (Postfix) with ESMTP id B02044769F1 for ; Thu, 13 Jun 2002 15:29:57 -0400 (EDT) Received: from desenvolv (200.221.24.99) by studer.bol.com.br (5.1.071) id 3CFE81FC00326E33 for pgsql-admin@postgresql.org; Thu, 13 Jun 2002 16:29:33 -0300 Message-ID: <003101c21310$c2ccc780$3a3c620a@catnet.com.br> From: "Robson Martins" To: Subject: Err sum number with Date ? Date: Thu, 13 Jun 2002 16:30:22 -0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002E_01C212F7.9D565CA0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Sender-IP: 200.245.222.20 X-Archive-Number: 200206/88 X-Sequence-Number: 4523 This is a multi-part message in MIME format. ------=_NextPart_000_002E_01C212F7.9D565CA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable What err ? Order By (Sum(Qtde)/(1+current_date-Max(Data))) Desc Regards, Robson ------=_NextPart_000_002E_01C212F7.9D565CA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
What err ?
 
Order By (Sum(Qtde)/(1+current_date-Max(Da= ta)))=20 Desc
 
 
Regards,
 
Robson
------=_NextPart_000_002E_01C212F7.9D565CA0-- From nickf@ontko.com Thu Jun 13 20:12:50 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 9CAA6476EE8 for ; Thu, 13 Jun 2002 16:12:50 -0400 (EDT) Received: from shire.ontko.com (shire.ontko.com [199.164.165.1]) by postgresql.org (Postfix) with ESMTP id A0668476F32 for ; Thu, 13 Jun 2002 16:03:46 -0400 (EDT) Received: from nick (bilbo.ontko.com [199.164.165.101]) by shire.ontko.com (8.9.3/8.9.3/Debian 8.9.3-21) with SMTP id PAA08682; Thu, 13 Jun 2002 15:02:55 -0500 X-Authentication-Warning: shire.ontko.com: Host bilbo.ontko.com [199.164.165.101] claimed to be nick Reply-To: From: "Nick Fankhauser" To: "Robson Martins" , Subject: Re: Err sum number with Date ? Date: Thu, 13 Jun 2002 14:59:49 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 In-Reply-To: <003101c21310$c2ccc780$3a3c620a@catnet.com.br> Importance: Normal X-Archive-Number: 200206/91 X-Sequence-Number: 4526 Robson- In this, and your last question, the problem is that you are using functions from Microsoft Access. You'll keep running into this until you learn about the equivalent functions in PostgreSQL. The PostgreSQL functions are explained here: http://www.postgresql.org/idocs/index.php?functions.html You may also want to learn how to create your own functions in case there is no equivalent: http://www.postgresql.org/idocs/index.php?sql-createfunction.html -Nick -------------------------------------------------------------------------- Nick Fankhauser nickf@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788 Ray Ontko & Co. Software Consulting Services http://www.ontko.com/ -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Robson Martins Sent: Thursday, June 13, 2002 2:30 PM To: pgsql-admin@postgresql.org Subject: [ADMIN] Err sum number with Date ? What err ? Order By (Sum(Qtde)/(1+current_date-Max(Data))) Desc Regards, Robson From clarson@eldocomp.com Fri Jun 14 17:35:05 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id AE85B47596A for ; Fri, 14 Jun 2002 13:35:05 -0400 (EDT) Received: from ecint.ecinet.com (smtp.eldocomp.com [205.159.99.3]) by postgresql.org (Postfix) with ESMTP id 6D228476CE9 for ; Fri, 14 Jun 2002 13:26:39 -0400 (EDT) Received: from CHAD-WIN (chad-win.ecinet.com [192.168.22.228]) by ecint.ecinet.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id M7SGRL7G; Fri, 14 Jun 2002 10:26:38 -0700 Message-Id: <4.2.2.20020614102029.00a75d20@ecint.ecinet.com> X-Sender: clarson@ecint.ecinet.com X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.2 Date: Fri, 14 Jun 2002 10:26:35 -0700 To: , "Robson Martins" , From: "Chad R. Larson" Subject: Re: Err sum number with Date ? In-Reply-To: References: <003101c21310$c2ccc780$3a3c620a@catnet.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Archive-Number: 200206/101 X-Sequence-Number: 4536 At 12:59 PM 6/13/02 , Nick Fankhauser wrote: >In this, and your last question, the problem is that you are using >functions from Microsoft Access. You'll keep running into this until you >learn about the equivalent functions in PostgreSQL. Further, learning ANSI SQL and limiting your syntax to that defined there, so that if (God forbid) you should need to replace your PostgreSQL with something like Informix or Oracle you won't face the same problem all over. In otherwords, don't use any database's extensions unless there is a compelling reason to do so. Unfortunately, that means you have to be able to identify what =is= an extension, something Microsoft tries very hard to hide. In fact, if you were truly compulsive about such things (and I am), you would only access the database through ODBC. That would make changing database engines practically painless. Layer both your view of the system, and the software that implements it. -crl -- Chad R. Larson (CRL22) chad@eldocomp.com Eldorado Computing, Inc. 602-604-3100 5353 North 16th Street, Suite 400 Phoenix, Arizona 85016-3228