I have to finish this project for tomorrow-so I'll Appreciate quick reply.
I need to do reports in my projects. now I've created Data Environment and all that but in the SQL the only thing that work is if I select the entire table from the database. (like "select * from tbl_table" the problem is, I have one Variable that I need from another table(because it appears as a number in table1 and the name is written in table2-and I need the name. so I tried to write "select tbl2_name from tbl2 where tbl1_number=tbl2_number"
well..something like that..
I got here from google so I don't know the rules here or anything..sorry if I did something wrong.

Recommended Answers

All 3 Replies

paste actual code

We don't do your homework for you.

Without a tables' structure, it is hard to give an usefull response.
As I can see, you need an inner join between table1 and table2, something like

select tbl2_name from tbl2 t2
inner join tbl1 t1 on t1.tbl1_number = t2.tbl2_number
where t1.tbl1_number = anumber

Ionut

paste actual code

We don't do your homework for you.

I thought I described a very specific question. If I didn't express myself well Enough and you thought I wanted you to do the hard work for me than I'm sorry. anyways, after some tries I succeeded to solve it. but thanks anyway [=
if anyone cares, the code I came up with: SELECT tbl_table1.tbl1_num,tbl_table2.tbl2_name, FROM tbl_table1, tbl_table2 WHERE val(tbl_table1.tbl1_code) = val(tbl_table2.tbl2_code) ORDER BY tbl_table1.tbl1_num

and thanks Ionelul!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.