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
 left help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

masond
Constraint Violating Yak Guru

256 Posts

Posted - 08/01/2012 :  13:27:36  Show Profile  Reply with Quote
Hi guys and girls

I need some more help to match different tables together
I need a logic to say whats the postcode in query1, and return the rm in query 2

however i if the rm_sales_band is between 2m-4m, ignore the postcode logic and apply the name TEST,

If the value is 4m+ then apply the postcode logic

Within query 2, pca there can either be 1character or two.

Eg pca

AB = Aberdeen
B = Birmingham


please find attached two screen prints
Query
query2

lookign forward to your help

ps i have two screen prints i want to upload, but i dont know how to do it. any suggestions ?


Edited by - masond on 08/01/2012 13:30:44

robvolk
Most Valuable Yak

USA
15567 Posts

Posted - 08/01/2012 :  13:42:19  Show Profile  Visit robvolk's Homepage  Reply with Quote
Use imgur: http://imgur.com/

Once you upload your images there, copy the links and paste them into your post.
Go to Top of Page

masond
Constraint Violating Yak Guru

256 Posts

Posted - 08/01/2012 :  13:48:40  Show Profile  Reply with Quote
hi

Please find attached links, there should be two screen prints
query and query2

http://imgur.com/gqkND,rQ4Ql
Go to Top of Page

Lamprey
Flowing Fount of Yak Knowledge

3856 Posts

Posted - 08/01/2012 :  14:59:31  Show Profile  Reply with Quote
Here are some links that can help you prepare your question along with sample data (DDL & DML) as well as expected results. It is much easier for us non-paid people willing to help you with your questions if you provide the basiscs as described in these links:
http://bi-polar23.blogspot.com/2007/08/loading-multiple-excel-files-with-ssis.html
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


As a side, note.. I assume you are already locked into your schema, but column names like RM and PCA are not very good names. "Object" names should be much more descriptive. You might be interested in ISO 11179 for how to name things:
http://metadata-standards.org/11179/

Edited by - Lamprey on 08/01/2012 15:02:44
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.05 seconds. Powered By: Snitz Forums 2000