Forum Replies Created

Viewing 15 posts - 151 through 165 (of 429 total)

  • RE: Calculate the last working day of the previous month - Resolution

    I think this will work too (Holidays Not Considered)

    DECLARE @LastWorkingDayOfPreMonth VARCHAR(12)

    DECLARE @DateToCheck DATETIME

    SET @DateToCheck = '05/10/2005'

    SELECT @LastWorkingDayOfPreMonth = CONVERT(VARCHAR, DATEADD(DAY, 0 - ((DATEPART(DAY, @DateToCheck)) +

         CASE WHEN DATENAME(WEEKDAY, DATEADD(DAY, 0...

  • RE: Building Dynamic WHERE Clause in Procs

    Dynamic Search Conditions in T-SQL 

    (Thanks to Remi)

    Beat me by a min

  • RE: avoid dynamic sql with zero or more params

    select value from table

    where

     p1 = case when @p1 is null then p1 else @p1 end and

     p2 = case when @p2 is null then p2 else @p2 end

     

    if the columns are nullable...

  • RE: Using parameters inside a SP

    ) Congradulations for the new name.

  • RE: Using parameters inside a SP

    CREATE PROCEDURE Test

     @statusID int = 0

    AS

    SELECT * FROM tblStatus

    WHERE

      fldstatus = CASE WHEN @statusID = 0 THEN fldstatus ELSE @statusID END

    GO

    /*******************************************

    As mentioned by rqR'us ??????????!!!!!!!(R*m*)

    Will...

  • RE: String variable ....

    declare

    @SQLString varchar(1000),

    @TableName varchar(30),

    @PackageID int

    set @TableName = 'INDP'

    set @PackageID = 1

    set @SQLString = 'insert into DTSAudit (ComboID, RecordCount)

    select combo.CID, rc.RcCnt

    from

     (select ''' + @TableName + ''' as TblNm,...

  • RE: Real Data Type data is not inserting properly when It is more than 7 digits.

    Real takes 7 digits & Float takes 15 digits. I never had a chance to use this datatype. Can any one please give an example or use of this datatype.

    BOL

    float...

  • RE: Split data in SQL Table

    If it wouldn't be a problem to add another sequenced refernece number then it would be simple like

    SELECT * FROM TableName WHERE NewSequence BETWEEN 0 to 10000

    SELECT * FROM TableName...

  • RE: Dynamic SQL Question

    If you are using SQL Server 2000 the length of VARCHAR is 8000.

    If you are with a version limits to 256 character length you can combine two variables to...

  • RE: Date comparison weekly

    exec govinn.GotoWeekEnd     

    followed by

    exec govinn.ResumeNightSleep   

    with

    exec govinn.TakeALotofbeer

    Sounds like melody

  • RE: Date comparison weekly

    Yes. I see how I will be completing my Stored Procedure Now.

  • RE: Date comparison weekly

    I could not believe myself.

    As I closed my query analyzer window I could not give the queries I was trying. was so stupid. But why am I not getting answers...

  • RE: Date comparison weekly

    I was able to make it. Thanks for your help??

    Let me know if there are any easier ways.

    SELECT CallDate, DataDate,

     1. * Calls / Qty CallsPerCar

    FROM

     @MyCalls A

    LEFT OUTER JOIN

     @MyCars B

    ON

     DATEDIFF(DAY, DataDate,...

  • RE: Date comparison weekly

    /* I gave the results for firat 11 days it will continue like this */

    /*

    Calls are recorded daily and cars are counted weekly

    I have to create a report how...

  • RE: any ideas to do it without VB ASAP thanks

    You said

    table F has most recent and correct data and can not be overwritten with values from table D

    So In Table F key 1 has 12 and Table D...

Viewing 15 posts - 151 through 165 (of 429 total)