Forum Replies Created

Viewing 15 posts - 4,636 through 4,650 (of 5,504 total)

  • RE: Error in converting from datediff(,,) to Varchar()

    amitabhssinha (12/31/2009)


    This is part of my query:

    (CASE

    WHEN (DATEDIFF(second,Actual.ActualDepartTime,Schedule.SchdDepartTime)/60) >=60

    THEN Convert(nvarchar(10),(DATEDIFF(second,Actual.ActualDepartTime,Schedule.SchdDepartTime)/60)/60)+' '+'hr'

    Else (DATEDIFF(second,Actual.ActualDepartTime,Schedule.SchdDepartTime)/60) +' '+'min.'

    END) AS DeptEarly

    Yep, you're "trapped" by SQL Servers concept to define the...

  • RE: Holiday Coverage

    I know a company that runs the following concept:

    During weekend and Holiday there will be a three level support system:

    Level 1: On Call

    You have to be reachable by phone for...

  • RE: Error in converting from datediff(,,) to Varchar()

    amitabhssinha (12/31/2009)


    While converting from Datediff(second,date1,date2) to varchar() I am getting following error :

    "Syntax error converting the nvarchar value '95 hr' to a column of data type int."

    Anyone can please show...

  • RE: Accidental DBA class on web (note cost = $68)

    .. or just stay around here, look through the forums and read some articles.

    The money you saved could be spent on some good books for deeper insight on subjects you...

  • RE: How do you insert Data into one table from two other tables

    What have you tried so far?

    Also, please read and follow the recommendation in the first link in my signature on how to post sample data.

    What would you insert into the...

  • RE: Normalize data using Pivot WITHOUT using Aggregate function

    Nice one, Chris!!

    Another overcomplicated effort from the peanut gallery.

    I wouldn't take it that serious... if the requirement would have been to always have a group of 6, then there would...

  • RE: SQL 2005: Error calling a sproc from my new sproc

    Can you call the proc directly, using the required input values?

    Completely different direction:

    Are you sure the proc you're calling is used by the 3rd party application at all? Maybe it's...

  • RE: Normalize data using Pivot WITHOUT using Aggregate function

    How about this to assign a group number to each set regardless of the number of rows?

    ;with cte1 AS

    (

    SELECT id,

    row_number() OVER (order BY id) AS row

    FROM @school...

  • RE: Dateadd, Datediff function Question

    Let me quote my question/recommendation from above:

    lmu92 (12/23/2009)


    ...

    What would happen if you'd store the data "as is" into a SQL Server staging table and go from there?

    I don't think it's...

  • RE: Translating SQL 2005 script to SQL 2000

    AndrewSQLDBA (12/30/2009)


    I fired some guy for prefixing all the table names that way. That is very poor naming convention.

    Andrew SQLDBA

    I'd rather fire the guy who'd be responsible for the rules...

  • RE: Translating SQL 2005 script to SQL 2000

    Actually, you do have a direct reference to sysobjects.object_id:

    Example:

    SELECT * FROM sysobjects WHERE object_id

    is equal to

    SELECT * FROM sysobjects WHERE sysobjects.object_id

    The original statement just left out the table qualifier.

  • RE: Translating SQL 2005 script to SQL 2000

    What exactly is your question?

    You're "throwing" almost 250 lines of code at us and didn't even tell us what to do with it...

  • RE: Dateadd, Datediff function Question

    bigclick (12/23/2009)


    Thanks for the CASE statement advice. When I run it to select from the source however, it doesn't like the ISNUMERIC. The data source is from a...

  • RE: How to loop through fields rather than records...

    Attached please find an example of how I would do it.

    Please note that I didn't completely populate MSH, EVN, PID, and PV1 rows. But it basically would follow the concept...

  • RE: Need help with date function please!!

    Would something along those lines work?

    DECLARE @date datetime

    SET @date ='20091226'

    SELECT

    CASE

    WHEN day(@date) % 7 = 5 THEN 'run'

    ELSE...

Viewing 15 posts - 4,636 through 4,650 (of 5,504 total)