Forum Replies Created

Viewing 15 posts - 1,921 through 1,935 (of 3,544 total)

  • RE: value of select column as an argument in a function

    LTRIM(STR(ColumnB,20,ColumnA))

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Strange think with a string chain

    Your problem is the misuse of the SUBSTRING function

    SUBSTRING ( expression , start , length )

    try this

    set @strNoEmple = convert(int,substring(@strLinea,6,10))

     

    set @strApePaterno = substring(@strLinea,16,20)

    set @strApeMaterno = substring(@strLinea,36,20)

     

    set...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Trigger SQL to UPDATE Only row being Updated

    You need to JOIN the inserted table to the updated table using the primary key, e.g.

    UPDATE a

    SET ChangeDate = GETDATE()

    FROM TABLE_A a

    INNER JOIN inserted i

    ON...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Query statement with Julian/Georgian date field

    Can you explain "Georgian" ?

    I always understood Julian dates were YYDDD or YYYYDDD format

    What do the Date & Time values refer to ?

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Please help in Outer join

    My guess would be

    SELECT h.salesrep_Name,d.disp_code,[description],count(m.act_status)

    FROM histdata h

    CROSS JOIN dispositions d

    LEFT OUTER JOIN modifiedcalldata m

      ON m.prog_sol_number = h.prog_sol_number...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: BULK INSERT ERROR MESSAGE

    Happy to help

    quoteIn BOL, their example shows "SQL_Latin_General" for the...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: BULK INSERT ERROR MESSAGE

    Create the file (e.g. C:\MyFolder\MyFile.fmt) using text editor like notepad

    therefore if your column name was DataCol and is 2500 chars long then create the file with the following on...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: BULK INSERT ERROR MESSAGE

    To bulk insert into a table that has an identity column you have to use a format file otherwise you will get the error

    Try this

    8.0

    1

    1  SQLCHAR  0  255  "\r\n" ...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: BULK INSERT PROBLEM

    Try using this fomat file

    8.0

    12

    1  SQLCHAR 0 1  "‘"     0 x     ""

    2  SQLCHAR 0 10 "’"     1 col1  ""

    3  SQLCHAR 0 10 "|"     0 x     ""

    4  SQLCHAR 0 4  "|"    ...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Where clause

    This will achieve the same without the WHERE clause

    SET FMTONLY ON

    SELECT Institution, Period FROM Transactions

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: substract the word from the list

    SELECT

    LTRIM(SUBSTRING(',' + t.words + ',', n.number + 1,

    CHARINDEX(',', ',' + t.words + ',', n.number + 1) - n.number - 1))

    FROM [numbers] n

    INNER JOIN @t t

    ON SUBSTRING(','...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: cross tab with dates

    DECLARE @start datetime, @end datetime, @sql nvarchar(200)

    SET @start = '20060401'

    SET @end = '20060420'

    SET NOCOUNT ON

    CREATE TABLE #temp (techid int)

    INSERT INTO #temp (techid) SELECT DISTINCT techid...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: How to create an aggregated field

    To show your results (treat year as one period) then

    SELECT a.GL_ID, a.GL_Name_VC,

    SUM(CASE WHEN a.Period_TI = 1 THEN Amount ELSE 0 END) AS [Op Bal],

    SUM(CASE WHEN a.Period_TI > 1...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Suming DateDiff

    DECLARE @from datetime, @to datetime

    SET @from = '2006-04-11 10:00:00'

    SET @to = '2006-04-11 11:00:00'

    SELECT COUNT(*)

    FROM (SELECT DATEADD(minute,n.number,@from) AS [Time]

    FROM master.dbo.spt_values n

    WHERE n.type = 'P'

    AND...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SlNo in Select Query

    or, if EmpID not consecutive

    SELECT (SELECT COUNT(*) FROM [Emp] b WHERE b.Dept = a.Dept AND b.EmpID <= a.EmpID)

    ,a.EmpID, a.Dept, a.EmpName

    FROM [Emp] a

    ORDER BY a.Dept ASC, a.EmpID ASC

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 1,921 through 1,935 (of 3,544 total)