Обсуждение: Err sum number with Date ?

Поиск
Список
Период
Сортировка

Err sum number with Date ?

От
"Robson Martins"
Дата:
What err ?
 
Order By (Sum(Qtde)/(1+current_date-Max(Data))) Desc
 
 
Regards,
 
Robson

Re: Err sum number with Date ?

От
"Nick Fankhauser"
Дата:
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


Re: Err sum number with Date ?

От
"Chad R. Larson"
Дата:
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