Forum Replies Created

Viewing 15 posts - 226 through 240 (of 291 total)

  • RE: help with syntax

    Based on the dates I figured his interview had already passed, and based on his attempted answers he probably bombed badly and has moved on to another project.  Though in...

  • RE: query result

    --You need SQL 2005 for this, but the following accomplishes what you want:

    --create an "in-memory" test table

    declare @t1_ table (col1_ int, col2_ char(1))

    --Populate the test table with your data

    insert into ...

  • RE: Store proc

    1. Are you sure there is data in the "Scheduled_Appointment" table for the date tested? (if not then where clause/join fails)

    2. If #1 is true are you sure there is...

  • RE: OSQL output stored procedure column formatting problem

    Jeff: Yep, that's simpler and better.  Nice call.  If he can't alter the orginal SP he shoud be able to create a second one that calls the first one and...

  • RE: Date ranges: per calendar week

    Since you didn't give an example of the output expected this is my best guess based on the information provided:

    set datefirst 1 --1 = Monday, 2 = Tuesday, etc

    select min(date_)...

  • RE: Get percentages

    Jeff: Nice!  But maybe just one little cast to get the decimal to round to 2 places

  • RE: BCP error -Unable to open BCP host data-file

    It still goes back to the basics.  When running the BCP command from the command line are you on your workstation or the server?  the xp_cmdshell is going to run...

  • RE: Get percentages

    Using your example data, the following should work

    BEGIN

    set nocount on

    declare @ProviderLink table (PLid varchar(10), PLworkRequestID varchar(10), PLcurrentStatus int, PLtat int, PLunworkable int)

    insert into @ProviderLink values ('PL203602',   'WR27904',        90,     39,      73)

    insert...

  • RE: Extract data from a string

    use the CHARINDEX string function.

    EXAMPLE:

    BEGIN

    declare @t_ table (col1_ varchar(20))

    insert into @t_ values ('12345xxxx')

    insert into @t_ values ('12345 xxxx')

    insert into @t_ values ('1234 5xxxx')

    insert into @t_ values ('12345yyyy')

    select * from @t_

    update...

  • RE: Get percentages

    What is (pl.pltat + pl.plunworkable) > '75' supposed to do? That actually ends that part of the statement and the "AS DECIMAL" accomplishes nothing.

    I guess I should have looked...

  • RE: Get percentages

    Change your last line to the following:

    AND (cast(((PL.Pltat + PL.Plunworkable) > '75' AS decimal) / COUNT(*) * 100) as decimal(5,2))

    the "as" clause as you were using it was trying...

  • RE: How to link to multiple IDs separated by a comma

    First hire someone who knows how to design a database in 3rd normal form. I would hate to see what the rest of your database looks like.

    If you must...

  • RE: OSQL output stored procedure column formatting problem

    Ok, I found a work around. Instead of using osql I used isqlw with a -C option and specified a configuration file that I created with Query Analyzer (tools,options),...

  • RE: OSQL output stored procedure column formatting problem

    I am able to replicate his problem. I created a quick SP:

    if exists (select 1 from sysobjects where id = object_id('uspTest_') and type = 'P') drop procedure uspTest_

    go

    create procedure...

  • RE: OSQL output stored procedure column formatting problem

    It would be helpful to see the actaul SP. Try adding -O (that is a capital O as an additional parameter to the osql call. That option prevents...

Viewing 15 posts - 226 through 240 (of 291 total)