[GENERAL] Convert number to string

2015-09-24 Thread Hengky Liwandouw
Hi, I don't have any idea how can I use postgres function to convert series of number (currency) to my own string. My string : F G H I J K L M N as the replacement for number : 1 2 3 4 5 6 7 8 9 Dozens = O Hundreds = P Thousands = C Ten thousands = B So. 200 = GP 2000

Re: [GENERAL] Crosstab function

2014-05-08 Thread Hengky Liwandouw
Thanks Sim, a very usefull information. From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Sim Zacks Sent: Wednesday, May 07, 2014 7:33 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Crosstab function What I have done in the

[GENERAL] Crosstab function

2014-05-05 Thread Hengky Liwandouw
Hi Friends, Could somebody help me with crosstab function ? I have warehouse table: CREATE TABLE tblwarehouse ( id integer NOT NULL, warehousename character varying(20) ); COPY tblwarehouse (id, warehousename) FROM stdin; 2 OFFICE 3 STORE2 \. And product

Re: [GENERAL] Crosstab function

2014-05-05 Thread Hengky Liwandouw
Hi David, Are you sure that there is no pure sql solution for this ? I think (with my very limited postgres knowledge), function can solve this. So far i can use command: select * from crosstab ( 'select produkid, warehouseid, onhand from tblproduct order by 1', 'select distinct

Re: [GENERAL] Crosstab function

2014-05-05 Thread Hengky Liwandouw
Very Clear instruction ! Thank you very much David. I will do it in my client app and follow your guidance. -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of David G Johnston Sent: Tuesday, May 06, 2014 11:01 AM To:

Re: [GENERAL] Return and sql tuple descriptions are incompatible

2014-05-01 Thread Hengky Liwandouw
user add warehouse, crosstab column name will change automatically. And also each row has total qty. Please give detail command for this. Thanks in advance ! -Original Message- From: Joe Conway [mailto:m...@joeconway.com] Sent: Wednesday, April 30, 2014 5:43 AM To: Hengky Liwandouw

Re: [GENERAL] Return and sql tuple descriptions are incompatible

2014-04-25 Thread Hengky Liwandouw
Hi, I have read the instruction, change warehouseid to text, spend several hours to test many option but it doesn't help. This is the new query : SELECT * FROM crosstab( 'SELECT produkid, warehousename, onhand FROM vwtest ORDER BY 1,2') AS ct (Produkid text, Store1

Re: [GENERAL] Return and sql tuple descriptions are incompatible

2014-04-25 Thread Hengky Liwandouw
-Original Message- From: Joe Conway [mailto:m...@joeconway.com] Sent: Friday, April 25, 2014 10:23 PM To: Hengky Liwandouw; 'pgsql-general General' Subject: Re: [GENERAL] Return and sql tuple descriptions are incompatible -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/25/2014 12:19 AM

[GENERAL] Return and sql tuple descriptions are incompatible

2014-04-24 Thread Hengky Liwandouw
Hi, I have the following crosstab command : Select * from crosstab($$select produkid, warehouseid,onhand from vwtest order by 1,2$$) as t (produkid VARCHAR, warehouseid integer) vwtest : CREATE OR REPLACE VIEW public.vwtest ( produkid, warehouseid, onhand) AS

Re: [GENERAL] Query runs slow

2013-11-24 Thread Hengky Liwandouw
Dear Kevin, After reading the link you gave to me, changing shared_buffers to 25% (512MB) of available RAM and effective_cache_size to 1500MB (about 75% of available RAM) make the query runs very fast. Postgres only need 1.8 second to display the result. Thanks a lot ! On Nov 24, 2013, at

Re: [GENERAL] Help : Sum 2 tables based on key from other table

2013-11-18 Thread Hengky Liwandouw
. This makes me headache :D Postgre really fast, has excellent feature, clear documentation, has great community and really so many plus point. Thanks you all. On Nov 18, 2013, at 4:47 PM, Raymond O'Donnell wrote: On 18/11/2013 02:16, Hengky Liwandouw wrote: Dear Friends, Please help

Re: [GENERAL] Help : Sum 2 tables based on key from other table

2013-11-18 Thread Hengky Liwandouw
0 END) AS out_sum FROM c GROUP BY product_id ) c USING (product_id) WHERE a.supplier_id='XXX'; Cheers, Ken On Mon, Nov 18, 2013 at 12:47 AM, Raymond O'Donnell r...@iol.ie wrote: On 18/11/2013 02:16, Hengky Liwandouw wrote: Dear Friends, Please help for the select

[GENERAL] Sum 2 tables based on key from other table

2013-11-17 Thread Hengky Liwandouw
Dear Friends, Please help for the select command, as i had tried many times and always can not display the result as what i want. I am looking for the solution on google but still can not found the right answer to solve the problem. I have 3 tables : Table A ProductID

Re: [GENERAL] Sum 2 tables based on key from other table

2013-11-17 Thread Hengky Liwandouw
Dear David, Thanks for your reply. Table A is product table contains ProductID, Name, Supplierid etc. Table B is initial stock contains ProductID, Qty Table C is the transaction table contains ProductID, date, in, out, remarks, etc As i use trigger to write to a log file for any INSERT, UPDATE

[GENERAL] Help : Sum 2 tables based on key from other table

2013-11-17 Thread Hengky Liwandouw
Dear Friends, Please help for the select command, as i had tried many times and always can not display the result as what i want. I am looking for the solution on google but still can not found the right answer to solve the problem. I have 3 tables : Table A ProductID

[GENERAL] Please Help ! Error with Access 2003

2007-03-01 Thread hengky liwandouw
Dear all, I have another problem with Access 2003 as front end with Postgre 8.1, ODBC version 8.02.02 Unicode. I just upgrade the Point of Sales Program to Access 2003 MDE, all station running XP Home wth Access 2003 on P4 3.0, 512MB Memory, 40GB HDD. Server run Windows Server 2003

[GENERAL] Strange Problem. Please Help.

2007-02-26 Thread hengky liwandouw
Dear all, I have a very strange problem with Access 2003 as frontend and PqSql 8.1 as backend. In my access application, i have order form with orderdetail subform. Subform recordsource, based on a saved Access query that has very simple calculated field AMOUNT that calculate