Forum Replies Created

Viewing 15 posts - 2,626 through 2,640 (of 5,504 total)

  • RE: error with function

    Michael answered the original question but I'd like to go one step further:

    Since all you need to return is the result of a select statement, you could use an iTVF...

  • RE: Need to Exclude One Of The Following

    :blush:OUCH!!:blush:

    I must have been totally out of my mind when replying... Of course, it's not possible to use column alias from a SELECT clause in GROUP BY, since the grouping...

  • RE: If statement

    could you be a little more specific regarding the errors you get?

  • RE: need help find overlapping dates in a table

    Stephen Harris-233385 (11/4/2010)


    I should have said overlapping ranges. You can't have a date range of rates that overlap another date range of rates with the same infoname

    make sense?

    Not really:

    CRATES...

  • RE: need help find overlapping dates in a table

    Stephen Harris-233385 (11/4/2010)


    ARATES

    BRATES

    CRATES

    A simple SELECT DISTINCT would return your required result... 😀

    We'd need a little more info what you define as "overlapping".

  • RE: need help find overlapping dates in a table

    what is your expected output based on your sample data?

  • RE: Need Calculation Performed Without Modifying Base Table(s)

    How about the following approach?

    CREATE VIEW [dbo].[viewname]

    AS

    SELECT SUM(QUANTITY) AS QtyTotal, RECEIPTNUM, RCPTLNNM, SLTSQNUM, SERIALNUM, QUANTITY, DATERECD, DTSEQNUM, UNITCOST, TRXSORCE, ITEMNMBR, QTYTYPE, BIN, MFGDATE, EXPNDATE, ROW_ID

    FROM tablename

    group by RECEIPTNUM, RCPTLNNM, SLTSQNUM,...

  • RE: Need Calculation Performed Without Modifying Base Table(s)

    Please post the error message you get as well as the statement you want to use to create the view.

    I guess a view is the right way to do it.

  • RE: Help with SQL Statement - Break/Continue

    Please tell us a few more details what you're trying to do. I'm sure (at this point) you won't need any kind of loop for the task...

  • RE: Are the posted questions getting worse?

    GilaMonster (11/4/2010)


    ...

    I'm seriously considering getting a voice recorder and recording all meetings and discussions. Openly and requesting everyone's permission. For 'documentation' purposes.

    It's been a while since one of our vendors...

  • RE: Is xp_cmdshell the only option?

    Would it be an option to create a sproc executed as a different user (impersonation) who's allowed to run xp_cmdshell with the package source path as input variable and assign...

  • RE: Database roles

    K. Brian Kelley (11/4/2010)


    ...

    Think of schema like we do namespaces. Create appropriate schema. Put the stored procedures in the schema. Assign appropriate permissions based on schema. That's how you...

  • RE: Is xp_cmdshell the only option?

    Another option would be to create an SSIS package and run it from within your sproc.

  • RE: Help with Query

    I think because of last activity date is less than 10/01/2009. the simple join won't work.

  • RE: Help with Query

    Your select top 1 clause lacks an ORDER BY. Therefore it'll return the first RANDOM row from your case_activities table.

    I guess you'd need an ORDER BY ca.activity_datetime DESC.

    As a side...

Viewing 15 posts - 2,626 through 2,640 (of 5,504 total)