SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 way to format this query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AdamWest
Constraint Violating Yak Guru

USA
357 Posts

Posted - 10/22/2013 :  22:37:51  Show Profile  Reply with Quote
I have to fetch some rows within a Crystal report. I need to select
from Orderhist a where
order# a = order# cr
and trncde is in 'pwb' 'pdb' 'pbb'

but i need then that trncde as a report field. also the order# cr is a formula field because its a subscript embedded 8 char within a 24 char. this is already available to the cr but can u do the where = on a formula field?

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 10/23/2013 :  01:28:42  Show Profile  Reply with Quote
you can if you make the query into derived table you can use it like below


select *
from
(
...
from Orderhist a 
where
order# a = order# cr
and trncde  in ('pwb','pdb','pbb')
)t
WHERE ..


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000