Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Mantle51
  • Content: Threads
  • Order by date
  1. Mantle51

    Remove Decimal function

    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...
  2. Mantle51

    Chr() function equivalent for T-SQL

    Hello, is there a T-SQL equivalent to VBA's Chr()? Thanks
  3. Mantle51

    UDF Error

    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 =...
  4. Mantle51

    Assinging UDT a value in .adp

    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 =...
  5. Mantle51

    View Code for System UDF

    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.........
  6. Mantle51

    IF Statement in SELECT Query

    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...
  7. Mantle51

    Function List for SQL 2000

    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...
  8. Mantle51

    MDX Functions

    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...
  9. Mantle51

    Error 1069 after loading SP3A

    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......
  10. Mantle51

    CASE statement in UDF

    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)...
  11. Mantle51

    Upsizing Queries with Functions from .mdb

    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
  12. Mantle51

    SQL Query Analyzer

    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
  13. Mantle51

    Calculating all discrete permutations

    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...
  14. Mantle51

    New Additions to VB Language

    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...
  15. Mantle51

    Updates to Language

    Hello, Is there any reference(electronic or hardcopy)that details additions or changes to VB language? Thank you
  16. Mantle51

    Dynamic Values in Excel Chart

    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...
  17. Mantle51

    Entering Expression in Aliased Field

    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...
  18. Mantle51

    FormatNumber Function

    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...
  19. Mantle51

    Format Trailing Zero in Query Design

    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
  20. Mantle51

    Text Export Formatting

    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...

Part and Inventory Search

Back
Top