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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

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

Constraint Violating Yak Guru

360 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?

Very Important crosS Applying yaK Herder

52326 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 Orderhist a 
order# a = order# cr
and trncde  in ('pwb','pdb','pbb')

SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next 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.02 seconds. Powered By: Snitz Forums 2000