Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. raynoel

    postgreSQL for months consume..

    Hello agaiN!! :) I used age(timestamp 'enrollmentdate') AS "Months Consume" ; to see how many months they alreaady consume, but error message state that **** ERROR: invalid input syntax for type timestamp: "enrollmentdate" *** though when you try to query the enrollmentdate it will show...
  2. raynoel

    How view remaining months.

    Thanks for your reply gwinn7 but im confuse on how to use the interval time.. can you provide me example on how for the query below, SELECT DISTINCT kh_expiry(enrollmentdate)-current_date, companyidfk FROM enrollment WHERE companyidfk = 101 AND enrollmentstatusidfk = 0; The kh_expiry uses the...
  3. raynoel

    How view remaining months.

    I was able to get the expiry date of a certain company in my database but I have problem on how to view their remaining months before the expiry date. I have function name kh_expiry which check the expiry date of a company. SELECT DISTINCT kh_expiry(enrollmentdate), companyidfk FROM...
  4. raynoel

    How to sum up the row? please see the code below.

    hi Feherke , I already solved the issue. the code below..... select sum(debit)-sum(credit) AS total ,compname from ( select sum(a.debit) as debit,sum(a.credit) as credit,d.compname from expenses a inner join consultation b on a.consultationidfk = b.consultationid inner join...
  5. raynoel

    How to sum up the row? please see the code below.

    thanks so much Feherke.... i'll try work this one today... hopefully it will going smooth... with your help... by the way I check your site... hmm.. you love hand codes really... so goodbye ide softwre...??..hehe...
  6. raynoel

    How to sum up the row? please see the code below.

    I check my no. 3 query, it has the same code of the two queries, hmmm.... what you mean ***** For your new selects you will need some aliases for the fields too. **** by the way I tried to copy your code another error received. **** ERROR: column "foo.compname" must appear in the GROUP BY...
  7. raynoel

    How to sum up the row? please see the code below.

    When I try to run the two scripts above i got an error ****** ERROR: subquery in FROM must have an alias HINT: For example, FROM (SELECT ...) [AS] foo. ****** I got new QUERY below which will display the sum.... QUERY 1 SELECT SUM(a.debit), SUM(a.credit), d.compname FROM expenses a INNER JOIN...
  8. raynoel

    How to sum up the row? please see the code below.

    I wanted to sum up the total in table expenses "debit" row. currently it's connected with 3 tables for the debit. Hope you can help me here. ------no. one query-------- SELECT a.debit, a.credit, a.action_date,d.compname, b.labfee, b.payee FROM expenses a INNER JOIN memberlaboratory b ON...

Part and Inventory Search

Back
Top