Forum Replies Created

Viewing 15 posts - 376 through 390 (of 1,217 total)

  • RE: Insert Select Summary

    "There are 28 fields to be inserted. 15 fields make up primary key. Only 2 fields are summed the rest are inserted as is."

    Maybe I didn't understand it correctly, but...

  • RE: Need to alter some code

    "...servicenames and some other generic data to be returned and grouped by distinct accountID"

    "there are an average of 27 serviceNames per account ID"

    Now I'm at a loss how to...

  • RE: Need to alter some code

    Well, since I have no idea what is in the function and the tables, I can't guarantee that this will work... but it should give you at least general idea:

    SELECT...

  • RE: return 0 when count=null

    Sorry for splitting it into 2 posts... now a hint at the solution, using the Dates and Status tables (I also had to add a date column to your simplified...

  • RE: return 0 when count=null

    Prepare permanent auxiliary table (also called "tally table") of all relevant dates, if you don't have it yet:

    CREATE TABLE Dates (number INT, date_char CHAR(10) NOT NULL, date_dt datetime

    CONSTRAINT PK_cislo PRIMARY...

  • RE: return 0 when count=null

    Hi,

    I have to repeat my question : what about dates within specified range, when there are no rows at all - do you want to display these days with all...

  • RE: Need help with Group By query

    Chris is right, if you supply a value directly (i.e. it is the same for all rows), you don't have to include it in GROUP BY clause.

  • RE: Need to alter some code

    Hi Jay,

    I think that you'll need to add another query (or probably 2 queries) to get these summary rows. Then you can use UNION if you want that it appears...

  • RE: INSERT HELP??

    Oh and one more thing... maybe you don't need to branch (IF something...) at all :

    INSERT INTO #Log (RecordType, RecordsUpdated,FirstEncDt,LastEncDt)

    SELECT CASE WHEN COUNT(*)=0 THEN 'No records updated' ELSE 'Some other...

  • RE: INSERT HELP??

    First, I would recommend changing this:

    SELECT TOP 1 SampleUnit_ID FROM #Sps

    IF @@ROWCOUNT...

    to:

    IF EXISTS (SELECT * FROM #Sps) /or NOT EXISTS - depending on what you are checking/

    And the insert -...

  • RE: return 0 when count=null

    Hi,

    what I would recommend is creating a new table Status(code INT, description VARCHAR(20)) - I suppose you don't have it, otherwise you wouldn't have to assign values in CASE. Then...

  • RE: Incremental Column Population

    Hello,

    just a few questions before we can start thinking about a solution...

    How do we know which row should get which number (of the 1 - 4000)? Or is it...

  • RE: Date sorting based on Varchar datatype

    We have already suggested several ways. Did you try them and found unsatisfactory? If so, say why, so that we know better what your main problem is.

    To sum up, offered...

  • RE: Warning

    To be honest, I don't think it makes sense at all... A report with 90 columns is bad idea. Do you think anyone will be able to work with it...

  • RE: Is There a limitation on the number of Paramters that a Stored Procedure Can Accept

    It probably means that you supply less parameters than what was defined for the procedure. This is possible only if the missing parameters have a default defined.

    Also, especially if...

Viewing 15 posts - 376 through 390 (of 1,217 total)