Forum Replies Created

Viewing 15 posts - 46 through 60 (of 98 total)

  • RE: Increase speed - Scalar Function

    Hehhehe

    The cursor code:

    DECLARE curD CURSOR FOR

    SELECT pac,st,ed,qt,idpac

    FROM @TabelaPACS

    ORDER BY pac

    OPEN curD

    FETCH NEXT FROM curD INTO @PAC,@st,@ed,@Qt,@id

    WHILE @@FETCH_STATUS = 0

    BEGIN

    -- Retrieve workingdays

    SELECT @Diff = dbo.workingDays(@st,@ed,0,0)

    SET @qtDay =

  • RE: Increase speed - Scalar Function

    Never used ITVF before, so how do i replace my function by the ITVF? 😀

  • RE: Increase speed - Scalar Function

    Thanks for the quick reply.

    I'll give it a try with the ITVF, and see if it solves my problem!? 🙂

    BTW, the @st it a datetime var used by the cursor,...

  • RE: Totals from movments Table

    I think that i get what i need...

    SELECT DISTINCT

    MA.Def,

    MAD.Reference,

    MAD.Quantity,

    [Movs] = COUNT(MO.ID),

    [Deliver] = SUM(MD.QuantityDelv),

    [Remain] = MAD.Quantity -SUM(MD.QuantityDelv)

    FROM #myMaster MA

    INNER JOIN #myMasterDetails MAD ON MA.ID = MAD.tblMASTER

    LEFT OUTER JOIN #myMov MO...

  • RE: Get Totals From Combined Rows

    Thanks for the tip, but i know that i should added some sample data, but my tables are a little bigger than the fields that i refer here, to do...

  • RE: Char to DateTime Seconds Rounding

    Oh Sh*** :blush:

    I just changed the date time in the first var forgot the second one, so i didn't see any difference! The code that i posted here was the...

  • RE: CTE Tracking

    Thanks for the answer, i didn't know the name of this to search in google.

    I have the employees/users in another table, i didn't realize that i didn't explained that. 🙂

    I'm...

  • RE: Group By With RollUp

    Anyone? :ermm:

  • RE: Group By With RollUp

    Now i'm stuck again....

    I had to add more three columns, and now i need to make a combination of them all and i don't see an easy way to do...

  • RE: Group By With RollUp

    I forgot the Having clause for the groups... :Whistling:

    Just need to add this:

    HAVING (GROUPING(PRSS.ReadyPr)=0) OR (GROUPING(PRSS.ReadyPr)=1 AND GROUPING(Project)=1)

  • RE: Never ending changes

    Thanks for both answers.

    I have to leave this problem to other time, now i have other priorities.

  • RE: Update with related tables

    Thanks

    I'll try this later, now i have to leave.

  • RE: Never ending changes

    No one? 🙁

  • RE: MAX vs TOP question

    Thanks

    I thought that i can't declare the top value as a variable, in the 2k it wasn't possible so once again i didn't try it... :blush:

  • RE: MAX vs TOP question

    Now i have another problem, i totally forgot that i can't call sp's inside functions...

    I need to add X days to a date, this days must be working days, i...

Viewing 15 posts - 46 through 60 (of 98 total)