Forum Replies Created

Viewing 15 posts - 211 through 225 (of 442 total)

  • RE: Many to Many - selecting records that don't include a word

    Hi Bob,

    You're right about the query, it fails to join when there is no match between the items table and the relationships, it all depends on what the requirements...

    Cheers,

    J-F

  • RE: Many to Many - selecting records that don't include a word

    With the sample data, it's a lot easier to help.

    Here's how I would do it, first get the items you do not want to show, and left join on the...

    Cheers,

    J-F

  • RE: Trigger skipping entering 1st row on Insert

    Hi,

    I don't see anything odd in your code, can you provide the source code for this function : dbo.fnparsestring().

    Maybe you need to send the parameter (0) to it, to get...

    Cheers,

    J-F

  • RE: Ran into more problems with CASE WHEN statements

    I corrected a few syntax errors you had, but I cannot test it.

    You need to put the syntax that way

    Select CASE WHEN a = B then X else Y...

    Cheers,

    J-F

  • RE: Ran into more problems with CASE WHEN statements

    Want to post your piece of code, we'll check for the error.

    Cheers,

    J-F

  • RE: Max of 2 similar dates, with different times

    Yes, I really love the solution, I'll keep a small script for that, it'll be useful!

    Thanks again

    Cheers,

    J-F

  • RE: Max of 2 similar dates, with different times

    GSquared (8/7/2009)


    Does this get you what you need?

    ;

    WITH Statuses

    AS (SELECT

    ...

    Cheers,

    J-F

  • RE: Max of 2 similar dates, with different times

    How's this? Gets the data based on the Max(Status_Date) then gets the underlying status(text) from the table.

    It is untested, since I cannot test it.

    --update prot2 max_status_date

    UPDATE prot2

    SET ...

    Cheers,

    J-F

  • RE: Loop to count

    Well, thanks for the times Gus.

    I'm surprised to see a huge select case solution beats the group by, but it makes sense, when you think about all the union...

    Cheers,

    J-F

  • RE: Loop to count

    jordon.shaw (8/7/2009)


    Actually, the primary key is the EMPLOYID, but its not unique. I know, I was like "What????" Anyway, what you did worked perfectly!!!

    Thanks,

    Jordon

    You are welcome, I'm happy...

    Cheers,

    J-F

  • RE: Loop to count

    I'm sure someone will something more elegant to work this out, but here's my shot at it:

    USE tempdb

    GO

    IF EXISTS (SELECT 1

    FROM sys.objects

    WHERE...

    Cheers,

    J-F

  • RE: Loop to count

    Tell me if that helps, even though I just saw Gus already had a solution before you even posted your data.. grrr, 😉

    Hope it helps..

    USE tempdb

    GO

    IF EXISTS (SELECT 1

    ...

    Cheers,

    J-F

  • RE: Loop to count

    Please provide the DDL of the table, and some sample data, in a ready to execute way, along with any query you have built so far, and I'll try to...

    Cheers,

    J-F

  • RE: Loop to count

    jordon.shaw (8/6/2009)


    Also, I'm not limiting my records, so if I run the loop, I want it to return for all records in the table. Meaning, if I run the...

    Cheers,

    J-F

  • RE: SQL Query by splitting the encoded text.

    steven (8/4/2009)


    Thanks it worked for me, but I don't know how to mark your reply as Answer. can you tell me?

    I don't think you can in this forum, well, just...

    Cheers,

    J-F

Viewing 15 posts - 211 through 225 (of 442 total)