Divide Date with interger

From: "Robson Martins" <robson-martins(at)bol(dot)com(dot)br>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Divide Date with interger
Date: 2002-06-14 14:39:23
Message-ID: 000a01c213b1$689f3a80$3a3c620a@catnet.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

As to divide one i number int number with date

Exemplo:

> Select Max(RazaoSocial) As mRazaoSocial, Max(Endereco) As mEndereco, Max(Bairro) As mBairro, Max(Cidade) As mCidade, Max(CEP) As mCEP, Max(UF) As mUF, ('(' || Max(DDD) || ') ' || Max(Fone1)) As mFone, Max(Data) As mData, Sum(Qtde) As mQtde, DescCor As mCor FROM Movimento, Clientes, Cores WHERE Movimento.CGC = Clientes.CGCCli And Clientes.TipoCli = 'N' And Clientes.CodCli > 1 And (Clientes.Class = 'A' Or Clientes.Class = 'B' Or Clientes.Class = 'C') And Movimento.CodCor = Cores.CodCor And Movimento.Data >=(current_date-(30*4)) And Movimento.CodProduto = '2491' And Clientes.UF = 'SP' Group By CGCCli, DescCor Order By (Sum(Qtde) / (current_date + 1 -Max(Data))) Desc

Error: ERROR: Unable to identify an operator '/' for types 'numeric' and 'interval'

You will have to retype this query using an explicit cast

Regards.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Nick Fankhauser 2002-06-14 15:22:00 Re: Divide Date with integer
Previous Message Tom Haber 2002-06-14 11:47:43 Database restriction