473,394 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Neeeeeed Help !!

1
Hi all
I'm using VB6.want to display data from two tables in my database in a grid ,here is a sample of my tables and what i want the grid to be as:
acc_cat table:
acat---------------acattitle
110 ----------------- Cash & bank
120------------------ Trading receivable
140------------------ Inventory
150----------------- Assets
151----------------- Advance


acc_chart table
acat------------ -acode----------------aTitle
110----------- --- 1101----------------- cash in hand
110---------------1102----------------- cash in bank
110----------------1103------------------main office cash
120----------------1201-------------------QIB
120----------------1202-------------------RFL
120----------------1203-------------------EMcO
140----------------1402-------------------raw material
140------------- --1403-------------------goods in transit
151----------------1513-------------------advance on salary
151-------- -------1514-----------------advance to employee

I want to display the above info as follows
110---------------cash & bank
1101--------------cash on hand
1102--------------cash in bank

120 ---------------trading receivable
1201--------------QIB
1202--------------RFL
1203--------------EMcO

140---------------- Inventory
1402----------------raw material
1403---------------good in transit

150---------------- assets

151-----------------advance
1513---------------advance on salary
1514---------------advance to employee

My database is Oracle 9i, I got a help from a friend he gave sql statement to get the output as i want ,it worked fine in SQL prompt but when i put the SQL query in recordset.open argument it seems cannot understand something !!
here is the sql statemnt i got from my freind:

select nvl(acode,acat) code,acattitle
from (select acat, null acode, acattitle
from acc_cat
where exists (select null
from acc_chart
where acc_cat.acat=acc_chart.acat)
union all
select a.acat, b.acode, b.atitle
from acc_cat a, acc_chart b
where a.acat=b.acat)
order by acat,acode nulls first;

any help ??!!
thanks
May 15 '07 #1
0 685

Sign in to post your reply or Sign up for a free account.

Similar topics

27
by: Cephalobus_alienus | last post by:
Hello, I know that macros are evil, but I recently came across a problem that I couldn't figure out how to solve with templates. I wanted to create a set of singleton event objects, and wrote...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.