Forum Replies Created

Viewing 15 posts - 2,611 through 2,625 (of 3,543 total)

  • RE: Count(distinct columnName) Problem

    select count(distinct SerialNumber),sum(cast(Direct as int)),

    (sum(cast(Direct as int)) * 100) / count(distinct SerialNumber)

    from TestInput

    group by DateEntered

    Note: Direct count is all direct including non distinct Serial number !!

  • RE: How to join on data in a long text field

    A bit clearer but can u post ddl of NAMSYSHTMLFORMS and SMSYSBASEVIEWDATA tables with data that would match with your example

    Example:FPKColumn="1" datatype="int"> <INPUT id=8 style="VISIBILITY: hidden" name=8 DEType="78"

     

  • RE: WITH ROLLUP sums ormula components, not results

    I agree with what Kenneth wrote.

    Without looking deeply into the query, it looks like you want to rollup a grouping of a calc based on the count of that grouping.

    The...

  • RE: How to join on data in a long text field

    Can you be more specific, what text is the primary key, sequence number. What tables & columns and what do you want to join it with?

    Some example of required output...

  • RE: Query question....

    Or this way

    delete suwp

    from sysuser_webpage suwp

    inner join webpage wp

    on wp.webpage_uuid = suwp.webpage_uuid

    and wp.state_code IN ('CT', 'NH')

    where suwp.sysuser_id = '2'

    sometimes joins run better than using...

  • RE: casting a varchar as datetime

    DECLARE @datestr char(6)

    SET @datestr = '060904'

    SET DATEFORMAT mdy

    SELECT CAST(STUFF(STUFF(@datestr,5,0,'/'),3,0,'/') as datetime)

  • RE: i have a date problem

    Check the Default Language on the logins. It affects date format.

  • RE: Count based on date intervals

    quoteThe next thing I have to figure out with it is that the customer told us this morning,...
  • RE: Division corrupt?

    I forgot to mention the the result and it's type is based on the types used in the calculation, as above any calcualtion using two ints will produce an int.

    It is...

  • RE: Division corrupt?

    Because sql converts the numbers to ints

    so

    SELECT 330 / 60

    is the same as

    SELECT CAST(330 as int) / CAST(60 as int)

    You need to tell sql that one of the number...

  • RE: Count based on date intervals

    Antares' solution is very similar to mine which was based on your first post and was only interested in assets that were 'IN'. Your example report was split by date.

  • RE: SQL SRV LEFT OUTER JOIN help

    select

    BORR.fico as borr1fico,

    BORR2.fico as borr2fico,

    BORR3.fico as borr3fico,

    a1.street as borr1street,

    a1.city as borr1city,

    a1.state as borr1state,

    a2.street as borr2street,

    a2.city as borr2city,

    a2.state as borr2state,

    a3.street as...

  • RE: Count based on date intervals

    DECLARE @SDate smalldatetime, @EDate smalldatetime

    SET @SDate = '2004-06-01'

    SET @EDate = '2004-06-05'

    SELECT d.ReportDate,

    SUM(CASE WHEN a.DeviceType = 'Monitor'

    THEN 1 ELSE 0 END) as [Monitors],

    SUM(CASE WHEN a.DeviceType...

  • RE: Need Help with T-SQL

    select a.TktNbr, a.[Current Status] as [Status],

    DATEADD(second,SUM(DATEDIFF(second,a.[Date Created],ISNULL(n.[Date Created],GETDATE()))),'') as [Time In]

    from (select ID, TktNbr, [Previous Status], [Current Status], [Date Created]

    ,(select min(ID) as [ID] from #BaseTable b2 where...

  • RE: Problem with: Warning: Null Value is eliminated by an aggregate or other SET operation.

    Is there a trigger on 360_QuestionResults?

    Did you post the complete procedure?

    If not, can you do so.

    What is the parameter @ParticipantId used for?

Viewing 15 posts - 2,611 through 2,625 (of 3,543 total)