Forum Replies Created

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

  • RE: ForEach Loop to delete all files in folder.

    pls give any dummy value to that variable..

    it is not pass that value to to file system task..

    for validation purpose only........

  • RE: Data Conversion Error

    PLS try below mentioned steps:

    (1) go to flat file show advance advisor .

    (2) go to input and output columns

    (3) go to filat file sorce output--> output columns

    ...

  • RE: how to make a split function for this parameter?

    try below code....

    declare @Questions varchar(MAX)='1-32|26,42-41|32'

    --select * FROM [dbo].split(@Questions)

    SELECT ...

  • RE: Split without delimiter based on position

    USE BELOW CODE...

    --DROP TABLE #temp1

    declare @STR varchar(100)='12345678910111213141516'

    declare @pos varchar(50)='1,1,2,5,4,2'

    declare @t int=0

    create table #temp1(id varchar(100))

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

    BEGIN

    set @t=SUBSTRING(@pos,1,(CHARINDEX(',',@pos)-1))

    INSERT INTO #temp1 VALUES( substring(@str,1,@t))

    SET @pos=SUBSTRING(@pos,(CHARINDEX(',',@pos))+1,LEN(@pos))

    set

  • RE: T-SQL query to add multiple valued report parameter

    first create function after call that function in your query...

    Text

    CREATE FUNCTION SPLIT(@VAL VARCHAR(MAX))

    RETURNS @T1 TABLE(COL1 VARCHAR(MAX))

    AS

    BEGIN

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

    BEGIN

    INSERT INTO...

  • RE: End Date Issue

    PLS TRY BELOW CODE:

    CREATE TABLE #tmp_end_date

    (ID INT,

    tgs_rec_eff_dt DATE,

    tgs_rec_end_dt DATE,

    SEQNUM INT )

    GO

    insert into #tmp_end_date values(12345,'15-Mar-2012',NULL,4)

    insert into #tmp_end_date values(12345,'10-Feb-2012',NULL,3)

    insert into #tmp_end_date values(12345,'2-Feb-2012',NULL,2)

    insert into #tmp_end_date values(12345,'05-Jan-2012',NULL,1)

    ;WITH A

    AS(SELECT *,DENSE_RANK()OVER(PARTITION BY ID ORDER BY ...

  • RE: Get the average of the data in the table.

    try below code.....

    declare @t1 table (day varchar(10),value int)

    insert into @t1

    select 'june 1',4

    union all

    select 'june 1',5

    union all

    select 'june 1',2

    union all

    select 'june 2',1

    union all

    select 'june 2',5

    union all

    select 'june 2',3

    select [Day], AVG(convert(decimal(10),[Value])) as...

  • RE: select records between a date range

    Pls check conditions...

    DECLARE @T TABLE (ID INT,DAT DATETIME)

    INSERT INTO @T(ID,DAT)

    SELECT 1,'2012-04-01 10:20:00'

    UNION

    SELECT 1,'2012-05-01 10:20:00'

    UNION

    SELECT 1,'2012-06-01 10:20:00'

    SELECT * FROM @T

    WHERE DAT >= convert(datetime, '04/01/2012')

    and DAT < convert(datetime, '06/15/2012')

  • RE: trying to change date to use next month

    DECLARE @DATE=(SELECT DATEADD(MM,DATEDIFF(MM,0,GETDATE())+1,0))

    use above variable to your query

    if next time to chage data is very easy...

  • RE: t-sql - days to week and days

    pls try below code:

    declare @days int=350

    select convert(varchar(10),(@days/7))+' '+case when (@days-((@days/7)*7))=0 then '' else convert(varchar(10),(@days-((@days/7)*7)))+'/7' end

  • RE: PEAK VALUES

    pls send ddl data...

  • RE: Date format Problem

    pls try below code.

    SELECT CUSTOMER_NUMBER,

    RECEIPT_ENTRY_ID,

    RECEIPT_DATE,

    CHECK_NUMBER,

    CHECK_DATE,

    CUSTOMER_BANK,

    RECEIPT_STATUS,

    RECEIPT_HEAD,

    RECEIPT_AMOUNT,

    SERVICE_TAX,

    REVERSED_DETAIL,

    ACCOUNT_HEAD,

    convert(nvarchar(20),PRINT_DATE) PRINT_DATE,

    PRINTED,

    RCVD_FROM

    FROM OPENQUERY(PRODERP,'SELECT

    CUSTOMER_NUMBER,

    RECEIPT_ENTRY_ID,

    RECEIPT_DATE,

    CHECK_NUMBER,

    CHECK_DATE,

    CUSTOMER_BANK,

    RECEIPT_STATUS,

    RECEIPT_HEAD,

    RECEIPT_AMOUNT,

    SERVICE_TAX,

    REVERSED_DETAIL,

    ACCOUNT_HEAD,

    PRINT_DATE,

    PRINTED,

    RCVD_FROM

    from Apps.xxcom_cust_receipt_details') a

  • RE: SQL taking long time

    please use #temp table in plase of CTE.

  • RE: Datatype Of A Column

    PLS TRY BELOW CODE..

    SELECT TABLE_NAME,COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH,NUMERIC_PRECISION,NUMERIC_SCALE FROM INFORMATION_SCHEMA.COLUMNS

    WHERE TABLE_NAME

    IN(SELECT name FROM sys.tables)

    ORDER BY TABLE_NAME

  • RE: Case When Help

    Pls try below code.

    CREATE TABLE #table1

    (

    ID Nvarchar (10),

    Date DATE

    )

    INSERT INTO #table1

    (ID,Date)

    SELECT '1', '12/31/2078'

    UNION ALL

    SELECT '1', '12/31/2011'

    UNION ALL

    SELECT '2', '12/31/2011'

    UNION ALL

    SELECT '2', '11/30/2011'

    UNION ALL

    SELECT '2', '10/31/2011'

    SELECT *,(SELECT...

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