Forum Replies Created

Viewing 15 posts - 31 through 45 (of 84 total)

  • RE: return a row (with constants) even if query comes up blank

    Adding to the post by christine.lawrie you can construct the UNION to only add the row if necessary:

    SELECT [name], [address], '12345' AS zip

    FROM mytable

    WHERE [NAME] = 'my_name'

    UNION ALL

    SELECT TOP...

  • RE: T SQL

    Should row numbers be specified in the answer if no ORDER BY clause is given? It's my understanding that a SELECT statement without an ORDER BY clause, returns the...

  • RE: Insert images into a sql table.

    Assuming a one time execution, I would populate a table (tblPicturesToImport_b) with the list of names with paths to import then execute something like the following:

    [P]

    [font="Courier New"]

    DECLARE @sql...

  • RE: Access Front end and SQL Backend table relationships

    Gwen,

    For next time:

    The Access Query Designer will handle your senario. You have to "Add" the tbl_Employees twice and relate one to Attorneys and one to Secretaries. When you...

  • RE: Problem in Developing view

    You have not given enough information for an exact solution, but here is one approach you might consider:

    WITH TeleData (TelecomOpertor, MocCounter, MocTotminutes, MocTotCharge

    ...

  • RE: Help with Triggers

    The problem is in not handling the possibility that there may not be a semi-colon in the part of the clause within the SUBSTRING() function.

    WHERE

    ( CHARINDEX(';', T.DTI_SHORT_LEGAL_DISPLY_TEXT) = 0

    OR

    LEN(T.DTI_SHORT_LEGAL_DISPLY_TEXT)...

  • RE: Help with Triggers

    I think it was right based on the information you had given up to that point. Nowhere do you mention that you want to update records where there is...

  • RE: Help with Triggers

    You don't need a CASE.

    Change your WHERE Clause from:

    WHERE

    T.DTI_SHORT_LEGAL_DISPLY_TEXT LIKE '%;%'

    AND T.DTI_SHORT_LEGAL_DISPLY_TEXT NOT LIKE '%;%;%'

    ...

  • RE: Help with Triggers

    You would have to give me more information, including sample data from the related tables. You did not give the value of DTI_SHORT_LEGAL_DISPLY_TEXT.

  • RE: Help with Triggers

    --You haven't given much information to work with, but based on your question, the following gives you an idea of what your trigger may look like:

    CREATE TRIGGER tr_Title_LastDocumentChangeDate ON Title_LastDocumentChangeDate

    ...

  • RE: How to add "dot" after every three digits in a number in sql 2005

    I put two records in table tblTest, column aText:

    46905730295547

    4690573010

    For a set-based solution, assuming the value you want to transform is [aText], you could use something like:

    SELECT [aText] AS Original

    , CASE...

  • RE: SQL Query (multiple rows)

    Basically the same solution that GSquared offered but without using CTE.

    SELECT r.[Number]

    ,f.[text1]

    ,r.[Name]

    ,r.[Date]

    FROM...

  • RE: HELP --- SQL Programming

    Another possibility:

    UPDATE kipp

    SET descr = ISNULL(b.[descr],'') AS [descr]

    FROM kipp a

    LEFT JOIN(SELECT proj_id, descr

    FROM kipp

    ...

  • RE: SQL statement

    Here is a revised version of my example that eliminates the need for the stored procedure (SP) to know what SelectedCategories are valid ahead of time. Using this approach,...

  • RE: SQL statement

    This solution allows you to eliminate the IF's. If the first if condition is not met then the WHERE Clause simply evaluates LastName = LastName. And, likewise for...

Viewing 15 posts - 31 through 45 (of 84 total)