ChristopherL
Registered User.
- Local time
- Today, 00:34
- Joined
- Jul 2, 2013
- Messages
- 90
Hi!
I'm having an issue with my query that I can't even figure out where to start with!
Here is an example how my tables looks like.
dbo.Murex
[Instrument] [Duration] [Volatily]
OMX2 4 0.18
OMX3 9 0.17
CMD1 2 0.16
NAS1 5 0.14
and a second table
dbo.DurationLength
[InstrumentLengthD] [Volatily]
OMX3M 0.19
OMX5M 0.17
CMD3M 0.17
NAS6M 0.15
(Where the value and M after OMX is Duration and Month, so OMX 3 Months)
What I want to do is the following:
I want the volatility in dbo.Murex to change depending on what length is closest to it's duration. So take OMX2 for example who have a duration of 4, the closest InstrumentLengthD to that is OMX3M, which has a volatility at 0.19. Then I want it to show 0.19 in the query for OMX2.
So I want it to pick the volatility for the closest InstrumentLengthD.
I am guessing that it will be multiple iif statements? I've never done several iif statements in a query before so would love some help with that!
//
Sorry for long post..
Chris
I'm having an issue with my query that I can't even figure out where to start with!
Here is an example how my tables looks like.
dbo.Murex
[Instrument] [Duration] [Volatily]
OMX2 4 0.18
OMX3 9 0.17
CMD1 2 0.16
NAS1 5 0.14
and a second table
dbo.DurationLength
[InstrumentLengthD] [Volatily]
OMX3M 0.19
OMX5M 0.17
CMD3M 0.17
NAS6M 0.15
(Where the value and M after OMX is Duration and Month, so OMX 3 Months)
What I want to do is the following:
I want the volatility in dbo.Murex to change depending on what length is closest to it's duration. So take OMX2 for example who have a duration of 4, the closest InstrumentLengthD to that is OMX3M, which has a volatility at 0.19. Then I want it to show 0.19 in the query for OMX2.
So I want it to pick the volatility for the closest InstrumentLengthD.
I am guessing that it will be multiple iif statements? I've never done several iif statements in a query before so would love some help with that!
//
Sorry for long post..
Chris