Hello,
I'm trying to write a function that will output 10 characters and remove the decimal.
CREATE FUNCTION dbo.fnRemoveDecRate(@Rate VARCHAR(20))
RETURNS CHAR(10)
AS
BEGIN
RETURN
RIGHT(REPLICATE('0',10) + @Rate, 10)
CASE CHARINDEX(@Rate,char(46),1)
WHEN 0 THEN...
Hello,
I'm attempting to convert VBA function into T-SQL but I keep getting error, "Return statements must include scalar valued arguments"
CREATE FUNCTION dbo.fnPrefixZeroAC(@AC_Num varchar(20))
RETURNS varchar(20)
AS
BEGIN
RETURN
If Len(@AC_Num) > 7
fnPrefixZeroAC =...
Hello,
How would I go about assigning the value in a form in .adp project to a user defined data type in SQL server. I've already created the variable as EndDate and I'd like the following event to reflect in SQL Server...
Private Sub Evaluation_ID_BeforeUpdate(Cancel As Integer)
EndDate =...
Hello,
After changing a UDF to a global function, that is, a system function on Master db, I can no longer see my code. This is obviously by design, but why and is there any way to view the code?
Thank you.........
Esquared writes,
"CASE is expressive, that is, evaluative. Queries are neither expressive nor procedural... call them operative"
Is not the SQL syntax declarative by nature? So, is that the same as saying queries are operative? Also, is CASE then declarative(as being a subset of expressive for...
Hello,
The following CASE statement works in this Select statement, however I was toiling unsuccessfully for quite some time to try to get an IF statement to accomplish the same thing. Is this not feasible?
SELECT [Evaluation_Date],CASE WHEN [Period_Code] = 'D' THEN 'YES' ELSE 'NO' END AS...
Hi,
I'm trying to create a select statement that determines if a single character in a field(the field is only one character) equals 'M'. I don't see IIF function available in SQL 2000 and I cannot use IF Then syntax in a SELECT statement. So how is this achieved without using a UDF?
Many...
Hello,
After installing OLAP Services, I thought I'd be able to incorporate the MDX functions(specifically IIF) into my SELECT statements with something like this:
SELECT [Evaluation_Date],fn_tblEvalSwitch([Period_Code])AS
'Period',fn_tblEvalSwitch([Audit_Indicator])AS...
Also may be worth noting, I installed OLAP Services from the main disk with the hope that all those MDX functions would become available. After installing and trying to write IIF into a SELECT statement, Query Analyzer still gave me a 'Does not exist' error. However, it was not until I loaded...
OK, the radio button 'Use SQL Server Authentication' is selected under Registered SQL Server Properties window, so I assume it's domain account. I perused through the Client and Server Network Utilities and saw nothing related to Account Locking or such. In fact nothing looks different, I just...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.