troubleshooting Question

problem in printing rows in mysql

Avatar of whspider
whspider asked on
PHPMySQL Server
9 Comments2 Solutions209 ViewsLast Modified:
hi,

i have 2 tables one for income and expense....i need to print them side by side i.e
i may get 3 rows in income and 2 rows ...in that case i have to print it in a table in the following format..how to i write query  for that and print the same
actually am having the following contents in mysql table

date field is of type timestamp

income

no       chequename        chequedate              amount
1         123                       12/10/2009               20000
2         124                       12/10/2009               30000
3         125                       12/10/2009               40000


expense

no       chequename        chequedate              amount
1         324                       12/10/2009               200
2         345                       12/10/2009               3000


i executed the following query but am getting muliple values of same records as am joining the 2 tables


SELECT * FROM cheque_details,cheque_details_reciept WHERE DATE_FORMAT(date(edate ), '%d/%m/%Y') = '12/10/2009' and DATE_FORMAT(date(erdate), '%d/%m/%Y') = '12/10/2009'




actually i shd get the following format in a table
 
                  INCOME                                                                 EXPENSE
no   chequename   chequedate   amount  #  no  chequename    chequedate   amount
1         123             12/10/2009     20000   #  1     324                  12/10/2009    200
2         124             12/10/2009     30000   #  2     345                  12/10/2009    3000
3         125             12/10/2009     40000
TOTAL                                         90000                                                             5000
ASKER CERTIFIED SOLUTION
Rajkumar Gs
Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros