Forum Replies Created

Viewing 15 posts - 106 through 120 (of 3,396 total)

  • Reply To: How can l group row data by date using window function?

    You have to sum first, and then use LAG on that result to get what you want... like this... Oh, and since you're new, I created tables for you etc....

  • Reply To: how to make cube choose certain fact table by default

    are you using Tabular or Multi-dimensional?

    in tabular, you don't need a separate date table. Just use ALL() to remove whatever filters you want from the evaluation context.

  • Reply To: Can't Restore DB

    Are you attempting to restore over the top of another database? (Did you change the name of the database you're restoring? You should have). Once you do that, you can...

  • Reply To: Access db

    "But in this case the business is using Access managing their own Access db. So looking for same functionality but with a SQL Server. Please advise? Thanks in Advance!"

    Maybe I...

  • Reply To: T-SQL Query Help

    Could you use EXISTS () with a correlated subquery instead of APPLY? (or is that just brutally slow?)

  • Reply To: Database Design Help

    a generic recipe is something like this:

    CREATE TABLE Recipe (

    FinalProductID INT NOT NULL,

    IngredientID INT NOT NULL,

    Quantity INT NOT NULL CHECK (Quantity>0)

    CONSTRAINT pkRecipe PRIMARY KEY (FinalProductID, IngredientID)

    );

    The "amount" output is the...

  • Reply To: Put output of a dynamic query using OpenQuery into a temporary table

    Disclaimer: I'm not an expert, but this worked for me... I didn't create mad dynamic SQL, but...

    ("Ingredient" is just some table I had in a database... nothing special.)  But  I...

  • Reply To: select query

    You can do this with text functions like CHARINDEX, LEFT, RIGHT.

    What have you tried?

  • Reply To: how to set to a variable

    Google-fu not working? See this page...

    use tempdb;
    go
    DECLARE @MyMachine NVARCHAR(128);
    SELECT @MyMachine = CAST(SERVERPROPERTY('MachineName') AS NVARCHAR(128))
    PRINT @MyMachine + ' is a piece of junk';
  • Reply To: Design Lessons for Software

    LOL. That's exactly how I feel about touchscreen radio controls. Are those things designed to kill me? I thought the whole idea was to be able to use the radio...

  • Reply To: SQL help

    T-SQL is pretty big (there are lots of functions etc). One way to learn it is to break it up into chunks. So you get a database and start asking...

  • Reply To: SQL help

    That's the way education is though. when I was in undergrad, one of my professors said something like "You thought I was here to teach you. That's where you're mistaken:...

  • Reply To: SQL help

    It's okay to be new. But please post what you tried in order to solve the problem. one thing it does is it forces you to recreate the problem for...

  • Reply To: get Lag based on Max and previous ShipDate

    I'd submit a tested query, but I don't have any data to test it on... so, all I can offer is a vague generality.

    If you use CROSS APPLY, you can...

  • Reply To: get Lag based on Max and previous ShipDate

    I'm not saying that Joe isn't insanely smart. Not at all. He absolutely is. He's just ... (What's the right word??!!) .. inflexible?  Kinda like an Aspie with Attitude?  Perhaps...

Viewing 15 posts - 106 through 120 (of 3,396 total)