Forum Replies Created

Viewing 15 posts - 46 through 60 (of 114 total)

  • RE: Need help in T-sql

    PLS TRY BELOW CODE...

    DECLARE @TA TABLE(ID INT,Comm_date_A VARCHAR(20), Commission_A INT,Type_A VARCHAR(20))

    INSERT INTO @TA

    SELECT 1,'10-Sep-12',50,'FIXED'

    union all

    select 2,'10-Sep-12',60,'VARIABLE'

    DECLARE @TB TABLE(ID INT,Comm_date_B VARCHAR(20),Commission_B INT)

    INSERT INTO @TB

    SELECT 1,'10-Oct-12',30 UNION ALL SELECT 1,'10-Oct-13',40...

  • RE: The conversion of char data type to smalldatetime

    pls try below code..

    DECLARE @StartDate VARCHAR(50), @EndDate VARCHAR(50), @UserId VARCHAR(50)

    SET @StartDate = '2001-07-01'

    SET @EndDate = '2013-12-29'

    SET @UserId = 'jamesm'

    SELECT [POLICY_ID]

    , ISNULL(VALUE,0) [VALUE]

    , ISNULL(UNITS,0) [UNITS]

    , TX , CASH_FLOW_SET , PRODUCT_CODE...

  • RE: create YTD in a Table

    CREATE TABLE #Table(

    [cod] [nchar](10) NULL,

    [year] [int] NULL,

    [month] [tinyint] NULL,

    [value] [float] NULL

    ) ON [PRIMARY]

    insert into #Table values ('cod1',2011,1,100)

    insert into #Table values ('cod1',2011,2,150)

    insert into #Table values ('cod1',2011,3,200)

    insert into #Table values ('cod1',2012,1,100)

    insert into...

  • RE: create YTD in a Table

    use below code:

    CREATE TABLE #Table(

    [cod] [nchar](10) NULL,

    [year] [int] NULL,

    [month] [tinyint] NULL,

    [value] [float] NULL

    ) ON [PRIMARY]

    GO

    insert into #Table values ('cod1',2011,1,100)

    insert into #Table values ('cod1',2011,2,150)

    insert into #Table values ('cod1',2011,3,200)

    insert into #Table values...

  • RE: string manipulation - Need help !

    pls try below code.

    declare @t varchar(2000)='BUILTIN\ADMINISTRATORS: [System Admin]YES;[Security Admin];[Server Admin];[setup Admin];[Process Admin];[Disk Admin]YES;[Database Creator]'

    select 'BUILTIN\ADMINISTRATORS: [System Admin]YES'+SUBSTRING(@t,PATINDEX('%Disk Admin]YES%',@t)-2,16)

  • RE: SSRS - Cannot Export to Excel

    Which version visual stdio is in installed in your system.

    because visual studio upto 2008 version ssrs excel export have only 2003.

  • RE: SSIS create text file and add text

    Steps:

    (1) create one folder (sourse) under that you are created .csv file as your text header only...

    (2) create another folder(destination) under that create same above mention file in destination also.

    (3)...

  • RE: Extract string between delimiters

    pls try below code....

    DECLARE @t table(id int,name varchar(50))

    insert into @t(id,name)values(1,'abc_def_cet_qwe'),(2,'abc_dek'),(3,'def_rag'),(4,'pes_rfg_def')

    DECLARE @Del1 varchar(50)='def'

    select id,case when PATINDEX('%'+@Del1+'%',name)>0 then SUBSTRING(name,PATINDEX('%'+@Del1+'%',name),len(@Del1)) end as Sup

    from @t

  • RE: Comma Field Parsing

    FIRST CREATE ONE FUNCTION.

    CREATE FUNCTION SPLIT(@VAL VARCHAR(MAX))

    RETURNS @T1 TABLE(COL1 VARCHAR(MAX))

    AS

    BEGIN

    WHILE CHARINDEX(',',@VAL)>0

    BEGIN

    INSERT INTO @T1 VALUES(SUBSTRING(@VAL,1,(CHARINDEX(',',@VAL))-1))

    SET @val=SUBSTRING(@VAL,(CHARINDEX(',',@VAL))+1,LEN(@VAL)) ...

  • RE: Comma Field Parsing

    pls try below code

    SELECT AccountId

    FROM #Comma

    WHERE PATINDEX('%5%',Commas)<>0

  • RE: Drill through color in ssrs

    Has of my understanding.

    first Report La had red:

    in detail report b

    write below mentation expression in color properties.

    =switch(@PAR=="LA","RED,

    ....)

  • RE: How to order by month which is varchar field according to date format?

    pls try below code

    declare @t1 table(id varchar(10))

    insert into @t1(id)values('Jan-12'),('Feb-12'),('Mar-12'),('APR-12')

    select *,convert(date,convert(varchar(10),'01'+'-'+id)) new from @t1

    order by 2

  • RE: SSRS Help

    Pls do the page breaks based on unitID wise.

    steps:

    Add a Fresh Group by following thsese steps.

    1. Select the Detail Row. Right Click.

    2. Click on Add Group --> Parent Group.

    3. In...

  • RE: query help

    pls try below code

    select case when Sex='M' THEN 'MALE' WHEN Sex='F' THEN 'FEMALE' END COLUMN_H,COUNT(CASE WHEN RaceCode='Black' THEN Sex END) AS Black,

    COUNT(CASE WHEN RaceCode='White' THEN Sex END) AS White,

    COUNT(CASE WHEN...

  • RE: How to retrive data in particular format?

    can you please check car table

    vinno 12345,12346 have same model_id 25. based on that one will come output.

    pls try below code...

    i have changed vinno(12346) realted model_id

    CREATE...

Viewing 15 posts - 46 through 60 (of 114 total)