Forum Replies Created

Viewing 15 posts - 4,726 through 4,740 (of 15,381 total)

  • RE: Days between to dates when one may be null ??

    You're welcome. Glad that worked for you.

  • RE: Days between to dates when one may be null ??

    jbalbo (5/28/2014)


    Hi

    trying to add a case statement to below so when enddate is null then use getdate()

    Thanks

    Joe

    DECLARE @startdate datetime2 = '2007-05-05 12:10:09.3312722';

    DECLARE @enddate datetime2 = '2009-05-04 12:10:09.3312722';

    SELECT DATEDIFF(day,...

  • RE: How to get the line item count from an order

    josetur12 (5/28/2014)


    Hi this is my DDL

    DROP TABLE [dbo].[Order]

    GO

    CREATE TABLE [dbo].[Order](

    [OrderID] [int] NOT NULL)

    Insert into [dbo].[Order]

    (OrderID)

    SELECT 100 UNION ALL

    SELECT 101 UNION ALL

    SELECT 102

    DROP TABLE [dbo].[OrderDetail]

    GO

    CREATE TABLE [dbo].[OrderDetail](

    [OrderID] [int] NOT...

  • RE: Can I use Output Into for this idea?

    Any chance you can turn that into insert statements? Also, need at least a row or two for Orders (that is in your select statement ). 😀

    I am still rather...

  • RE: Today's Random Word!

    Ed Wagner (5/28/2014)


    whereisSQL? (5/28/2014)


    Ed Wagner (5/28/2014)


    Sean Lange (5/28/2014)


    crookj (5/28/2014)


    Ed Wagner (5/28/2014)


    BWFC (5/28/2014)


    Geese

    Hunting

    :Wabbitt!

    Duck!

    Baseball

    Steroids

    Cheating

    Marriage

  • RE: Error when attempting to set variables value

    sgmunson (5/28/2014)


    It's even simpler:

    DECLARE @dteTo AS date = GETDATE();

    There's no need for a CAST or a CONVERT, as implicit conversion works just fine for this purpose.

    Is there an echo in...

  • RE: Can I use Output Into for this idea?

    How about the Order table and a few rows of sample data? I think I see where you are trying to go but want to be sure and with tables...

  • RE: help with deletion of multiple records

    MMartin1 (5/28/2014)


    You could try

    WITH Ordered AS

    (

    SELECT*, ROW_NUMBER() OVER ( PARTITION BY name ORDER BY Id) AS RN

    FROM #mytable where ID

    in ('TIX123','TIX999')

    )

    select * from ordered

    where RN=1

    to move the...

  • RE: Can I use Output Into for this idea?

    jamie 35248 (5/28/2014)


    I want to insert many rows at a time into two tables - I have a ValidationMessage Table with the ValidationMessageID and the message, and then an OrderValidationMessages...

  • RE: Performance issue with view

    sqlnaive (5/28/2014)


    Thanks Jeff. I compared the two execution plans and saw that with where clause it was considering clustered index scan for one of the table while without where clause...

  • RE: Get Consecutive Records

    One other point of concern. I noticed you are using the REAL datatype. This is not an exact numeric type, it is an approximate datatype so if accuracy is important...

  • RE: Get Consecutive Records

    mrmnew (5/28/2014)


    I am needing to get average and total downtime hours from a table. I have two source tables, DOWN (records with recorded downtime hours) and PROD (records with production...

  • RE: reporting and pictures using geographic cards is it possible using sql?

    prepaess (5/28/2014)


    Hi Sean Lange thanks for replying

    in fact i am too pressed i should finish this part now 🙁

    as i modified above it is the date of buying the...

  • RE: reporting and pictures using geographic cards is it possible using sql?

    Hi and welcome to the forums. In order to help we will need a few things:

    1. Sample DDL in the form of CREATE TABLE statements

    2. Sample data in the form...

  • RE: Store procedure only output one select statement

    adonetok (5/28/2014)


    There are about 10 select statements in a store procedure.

    All select statements are need.

    Is it possible to output only the result of last select statement?

    Remove the other select statements?

Viewing 15 posts - 4,726 through 4,740 (of 15,381 total)