Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Query from 2 entities

Author  Topic 

skiabox
Posting Yak Master

169 Posts

Posted - 2008-01-23 : 09:07:32
I have a table and a view.

This query

SELECT *
FROM ErmisUser.QBEPROK
WHERE ErmisUser.QBEPROK.bedaflarr = '1'
AND LEFT((ErmisUser.QBEPROK.bedakind), 1) <> 'P'
AND ErmisUser.QBEPROK.bedalog = 8932

returns a result from the view(QBEPROK) where the account number is 8932.

I want to see the result of this query where bedalog = bereg.berelog which is a field of the table(bereg) containing account numbers.
Thank you for your help!

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-01-23 : 09:11:39
[code]SELECT *
FROM ErmisUser.QBEPROK JOIN bereg ON QBEPROK.bedalog = bereg.berelog
WHERE ErmisUser.QBEPROK.bedaflarr = '1'
AND LEFT((ErmisUser.QBEPROK.bedakind), 1) <> 'P'
AND ErmisUser.QBEPROK.bedalog = 8932[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

skiabox
Posting Yak Master

169 Posts

Posted - 2008-01-23 : 09:48:40
Thnx a lot for your help.The query is working fine but I can't use it as I like in Crystal Reports.Is there any person in here that have knowledge of crystal reports?Thnx again for your time!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-02-14 : 06:35:45
quote:
Originally posted by skiabox

Thnx a lot for your help.The query is working fine but I can't use it as I like in Crystal Reports.Is there any person in here that have knowledge of crystal reports?Thnx again for your time!


Make the suggested query as procedure and use that procedure as source to your Crystal Reports?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -