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.........
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...
Hello,
After loading Service Pack 3A(to an existing SQL 2000 setup) I cannot access the SQL Server on my local machine. Error 1069 states 'The service did not start due to a logon failure'
Any ideas??
Thank you......
Hello,
I'm trying to create a System UDF that I can plug into any number of Select statements from various databases however, I keep getting error message 'Incorrect syntax near keyword CASE'
Thank you for your help
CREATE FUNCTION fn_tblEvalSwitch (@tblEvalField CHAR(1) )
RETURNS VARCHAR(20)...
Hello agin!
I have queries in an Access db that contain several "home-made" functions in the WHERE clause. Is it at all possible to upsize these to SQL server?
Thanks...........Mickey
Hello,
Brand new to SQL Server and I'm trying to run SELECT statements in Query Analyzer with the intended output on the bottom pane to be in grid format. Instead the message tab reads "The command(s) completed successfully.", while the grid tab is blank.
Thank for your help.
Mickey
Hello,
In a spreadsheet I have 4 categories running vertically with 4 items in each -16 cells. (They're excersies that are grouped by type) So what I've attempted to do is create a random selector of exercises; one from each group. It will initiate using the Seconds portion of the Now function...
Hello,
I'm looking for a documented history of when new Functions/methods/properties are added to the language. (Not looking for bug updates etc...)
Specifically, I'd like to know when CreateObject() and GetOpenFileName() functions came to surface. Also wonder why there is no GetOpenFileName in...
Hello,
I'm trying to assign variables as dynamic coordinates in ActiveChart object. However, I keep 'Application Defined or Object Defined Error' Typing "F2:F30" does work. How can I keep this dynamic?
Set Rng1 = Range("F" & i, Range("F" & i + 77))
Set Rng2 = Range("X" & i, "X" & (i + 77))
Set...
Hello,
Wondering, is there an expression I can enter in the field portion in query design that would populate with the string entered in a criteria for that query?
The criteria is from a field that is not shown in output and so when prompted, I type "Amphibian" and the field name that outputs...
Hello,
I've nested the FormatNumber function within my own creation which will be called in the field of a query, however the output never populates trailing zeros.
Function RemoveDecimal(ByVal Price As Long, ByVal NewPrice As Double) As Long
'''I use Price field twice as arguments when...
Hello,
I've put the following in my criteria field in query design with the intention of forcing trailing zeros in recordset output, but it will not work. The only instances when 6 decimal places are shown is when they are non-zero.
=Format([tblPosition].[Price],"0.000000")
Thanks.......Mick
Hello,
I have been given the task of exporting a table to a fixed width .txt file. I have set up the export specs as well as configured individual field parameters in table design however, 2 things are not reconciling:
1. I need to display a value with no decimal, hence 23.568 will appear
23568...
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.