Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: M. Tanveer Ul Hassan Shaheen
  Where is M. Tanveer Ul Hassan Shaheen?
 Rahim Yar Khan
 Pakistan
 M. Tanveer Ul Hassan Shaheen
 Tags
Subject: RE: how to query
Thread ID: 311014 Message ID: 311022 # Views: 32 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Tuesday, June 28, 2011 10:09:59 AM         
   


> >
> > Hi Tanveer,
> >
> > In general, SQL requires primary and foreign key values, so the data you posted are not a "relational database" table in a SQL sense, those two rows do not seem to be related to each other, no "key" value in common, right?
> > If there are however actually only exactly two rows in that pseudo table, you can do something like this to get the desired result:
> >
> > SELECT T1.ac_code, T1.dr_amount, T2.ac_code As accountOfCrAmount ;
> > FROM aTable T1, aTable T2 ;
> > WHERE T1.dr_amount > 0 AND T2.cr_amount > 0
> > 

> >
> >
> >
> > hth
> > -Stefan
> Helo Mr. Stefan
> thanks for reply. i have only one table and two records of same voucher no. every row has diferent account no and same amount both sides. now i want to combine into one row that show.
>
> cr_acno---dr_acno----vouch_no-----amount
>
> Thanks & Regards
>
> Tanveer Ul hassan


Yes, and the SQL example above is giving the result you described, doesn't it?



Regards
-Stefan

ENTIRE THREAD

how to query Posted by M. Tanveer Ul Hassan Shaheen @ 6/28/2011 9:11:00 AM
RE: how to query Posted by Stefan Wuebbe @ 6/28/2011 9:38:52 AM
RE: how to query Posted by M. Tanveer Ul Hassan Shaheen @ 6/28/2011 9:57:08 AM
RE: how to query Posted by Stefan Wuebbe @ 6/28/2011 10:09:59 AM
RE: how to query Posted by Cetin Basoz @ 6/28/2011 10:31:53 AM