Forum Replies Created

Viewing 15 posts - 601 through 615 (of 3,544 total)

  • RE: Wrap a varchar field based on character count and spaces

    WITH cteStart(N1) AS (

    SELECT t.N+1 FROM dbo.Tally t

    WHERE t.N < LEN(@Parameter)

    AND SUBSTRING(@Parameter,t.N,1) = ' '

    ),

    cteLen(N1,L1) AS (

    SELECT s.N1,

    ISNULL(NULLIF(CHARINDEX(' ',@Parameter,s.N1),0)-s.N1,8000)

    FROM cteStart s

    ),

    words (N1,Word,Grp) AS (

    SELECT l.N1,SUBSTRING(@Parameter, l.N1, l.L1),CEILING(l.N1 / 50.0)

    FROM...

  • RE: how to retrive a data.

    GilaMonster (12/8/2014)


    Errrr.....

    NOT EXISTS or NOT IN, if I've understood what you're asking.

    or EXCEPT 😀

  • RE: STUFF Function

    SELECTv.Vchvendor, SUM(vgl.vglamount) AS [VGLamount],

    STUFF((SELECT ','+ b.vchinvoicenbr

    FROMVoucherGLDist a

    JOIN Voucher b ON b.VchVoucherNbr = a.VGLVoucher

    WHERE b.VchVendor = v.Vchvendor

    FOR XML PATH ('')),1,1,'') AS [Invoices]

    FROMVoucherGLDist vgl

    JOIN Voucher v ON v.VchVoucherNbr = vgl.VGLVoucher

    WHEREvgl.VGLJEBatch...

  • RE: column grouping

    Add a parent group (grouping on Full_Name) to the details and give it a name (eg NameGroup)

    Add a column to the right of Time_Taken and set the expression to

    =Sum(Fields!Time_Taken.Value,"NameGroup")

    set the...

  • RE: column grouping

    Do you want Total_Time, Min_Time, Max_Time and Average_Time shown on each detail line or on a single total line

  • RE: Are the posted questions getting worse?

    Luis Cazares (12/2/2014)


    ...it can be easier to start from scratch if we can understand the problem, than fix a complete piece of s...

    I have this problem every time I look...

  • RE: Struggling with what should be a simple query!

    imex (12/2/2014)


    Hi,

    Try something like this:

    with CTE_User as

    (

    select

    UserID

    from MyTable

    group by...

  • RE: Round off to the nearest value

    Cast to int, ie

    SELECT CAST(45.67 as int)

    will give you 45

  • RE: Find Values Like Field Values

    If the string is less than 8000 chars you could use Jeff Moden's 8K splitter like this

    DelimitedSplit8K(REPLACE(REPLACEDetail,'id=',','),' ',''),',')

    to get a list of ids

    This depends on the variability of the contents...

  • RE: Can I extract a data item from a field that contains many data items?

    This means that either

    Mid(Fields!businessnamevalue.Value,1,2) chars 1 and 2

    or

    Mid(Fields!businessnamevalue.Value,3,2) chars 3 and 4

    has the value 'DA'

    which indicates to me that the field businessnamevalue does not always start with timeslot

  • RE: Can I extract a data item from a field that contains many data items?

    Add a calculated field and set the expression to

    =TimeSerial(Mid(Fields!businessnamevalue.Value,1,2),Mid(Fields!businessnamevalue.Value,3,2),0)

    this will give you a date type field in the dataset (the date will be 01/01/001 but the time will be correct)

    You...

  • RE: Can I extract a data item from a field that contains many data items?

    It depends on the content of fields!businessnamevalue that contains timeslot (as per your description)

    can you post examples of this field?

  • RE: Can I extract a data item from a field that contains many data items?

    Add a calculated field to the dataset that parses the column you mention and converts the start of the time period to TIME datatype and use that to order the...

  • RE: Are the posted questions getting worse?

    Well Jeff would have to employ GBAG (Glass By Agonizing Glass) or get an Overflow Exception 😀

  • RE: Group by using one column only

    pwalter83 (11/18/2014)


    David Burrows (11/18/2014)


    Try this

    ORDER BY CASE WHEN COMPANY_ROLE_CD = 'BK' THEN 1 WHEN BOOKED_BY_FLG = 'Y' THEN 2 ELSE 3 END ASC) AS [ROWID]

    it worked for me 🙂

    Thanks very...

Viewing 15 posts - 601 through 615 (of 3,544 total)