Hello!Is it possible to do this in SQL server with Function?VBA code isFunction getparams(sKey As String, Optional sTable As String = "Params") As Variant Select Case DLookup("type", sTable, "Key='" & sKey & "'") Case "N": getparams = DLookup("Nr", sTable, "Key='" & sKey & "'") Case "A": getparams = DLookup("Time", sTable, "Key='" & sKey & "'") Case "T": getparams = DLookup("Text", sTable, "Key='" & sKey & "'") Case Else: getparams ='' End SelectEnd FunctionTable looks:ParamsID | Key | Type | Nr | Time | Text 1 val1 N 10 2 val2 T 17.04.2009 3 val3 A Some text
And if i'm using in SQL getparams('val2') then return 17.04.2009Or getparams('val1') then return 10For example:SELECT (getparams('val1')-Limit) AS NumberFormatValue, getparams('val2') AS DateFormatValueFROM LimitsSorry if it is stupid question 