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...
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...
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...
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...
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...
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...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.