convert excel formula into sql

dai_lo

Registered User.
Local time
Today, 04:02
Joined
Jan 10, 2008
Messages
30
Hi,

I have problem convert the following excel formula in to sql code

can someone help me?

EXCEL (formula for column called MONTH)
=IF(OR(G5="LIBOR",G5="FRCOM"),IF(IF(J5="null",I5,J5)<$A$1,1,ROUNDDOWN((IF(J5="null",I5,J5)-$A$1+1)/365*12,0)),-1)

please copy the following sample data into excel for testing




thanks
Alice
 
Last edited:
here is the sample data in the attachement

Hi,

I have problem convert the following excel formula in to sql code

can someone help me?

EXCEL (formula for column called MONTH)
=IF(OR(G5="LIBOR",G5="FRCOM"),IF(IF(J5="null",I5,J5)<$A$1,1,ROUNDDOWN((IF(J5="null",I5,J5)-$A$1+1)/365*12,0)),-1)

please copy the following sample data into excel for testing




thanks
Alice
 

Attachments

the best way with complex things is to use a function

in the query
myvalue: myfunction(param1, param2 ...)

in a module
myfunction(param1 as ..., param2 as ..., ...) as whatevertype
code here
myfunction = whatevervalueisreturned
end function
 

Users who are viewing this thread

Back
Top Bottom