We help IT Professionals succeed at work.

Sql Query nightmare,help pls

299 Views
Last Modified: 2010-04-21
I have 2 tables, one table holds product code, start date, APR and Term....given the time loan was originated, the second table is Federal Home Loan, (FHL)..which holds date and Term only. FHL rates are given to us by Federal bank and we would like to compare.


Loan Table Fields
Code, StartDate, APR,Term
NV      11/24/1994   7.14   36

FHL Table Fields
Date,1,2,3,4,5,6,12,18,24,36,48,and so on

11/18/1994 6.13 6.24 6.47 6.79 and so on


Is there a way where first we can convert the date field on both tables to look like "November1994" so we can link these tables based on date and see what APR was given us by FHL and we then to customers.
Comment
Watch Question

CERTIFIED EXPERT
Awarded 2008
Awarded 2008
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Beautiful, thanks so much
Mark WillsTopic Advisor, Page Editor
CERTIFIED EXPERT
Distinguished Expert 2018

Commented:
G'Day,

Can see chapmandew is back in town... And between the time I had opened this, made coffee, thought about it, did a refresh, not only is Tim back, but has answer accepted as well !!

Linking the two dates is not the real probelm here... would imagine that there can be a lag between receiving those "official" rates, and then you have to match the correct column to the term given.
For that, I would be inclined to create a function which can be incorporated into your select statement....

e.g.

select Code, StartDate, APR,Term, dbo.uFHLRate(startdate,term) as Official_Rate from loan_table

But I guess that the function might need to wait for another question...

Author

Commented:
You are right, after accepting it i thought about exactly what you referring to, I guess i have to open this question again

Author

Commented:
Is there a way to open this question again and assign new points to it?
Mark WillsTopic Advisor, Page Editor
CERTIFIED EXPERT
Distinguished Expert 2018

Commented:
You are a premium member - just open a new question - thought premium members get unlimited points... and after all chapmandew did answer your specific question about dates and linking them together...

Just post the link here, or refer to this question in a new one so we can follow the link...

CERTIFIED EXPERT
Awarded 2008
Awarded 2008

Commented:
Mark WillsTopic Advisor, Page Editor
CERTIFIED EXPERT
Distinguished Expert 2018

Commented:
Ta muchly...
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.