Forum Replies Created

Viewing 15 posts - 886 through 900 (of 1,183 total)

  • RE: How to combine results form 2 statement

    SELECT

    sa.schoolc sch#,

    s.schname AS School,

    Have_logged_In = COUNT(CASE WHEN u.logindate IS NOT NULL THEN 1 END),

    Not_logged_In = COUNT(CASE WHEN u.logindate IS NULL THEN 1 END)

    FROM

    users AS u

    INNER JOIN stugrp_active AS...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How to add leading zeros?

    bdohmen (10/4/2007)


    Or, you can highlight the cells you want to change, right click and choose format. Select the Custom Category. Then in the Type: field, type in a...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Need to find records that match on one column but not on another

    mrpolecat (10/4/2007)


    Select t1.*

    From History t1

    join history t2

    on t1.DialID = t2.DialID and

    t1.ProjectID <> t2.ProjectID

    Close, but results in a cartesian product.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Need to find records that match on one column but not on another

    CREATE TABLE #test (dialId INT, projectId INT)

    INSERT #test

    SELECT 1,1 UNION ALL

    SELECT 1,1 UNION ALL

    SELECT 1,1...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Need to find records that match on one column but not on another

    So are there only duplicates in the table or can there be triplicates, quad's etc...?

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How to add leading zeros?

    Sent you a PM

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Need to find records that match on one column but not on another

    Select *

    From History

    Where ProjectID <> ProjectID

    I'm assuming one of these "ProjectID" fields resides in a different table?????

    The above statement will never return a record because ProjectId will always ProjectID.

    What is...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How to add leading zeros?

    OOPS, My previous formula was wrong. "=RIGHT(TEXT(A1, "0000000"), 7)"

    OK, so are you using excel to help in creating SELECT or UPDATE statements.

    If so, then the above will work and...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How to add leading zeros?

    What are you trying to accomplish? Not the adding leading zeros part, but what are you doing with the data after adding the zeros?

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How to add leading zeros?

    Enter the formula in ONE cell at the top of the list, click enter. Select the cell with the formula in it. Click and HOLD the bottom right corner of...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How to add leading zeros?

    =LEFT(TEXT(A1, "0000000"), 7)

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How to add leading zeros?

    =TEXT(A1, "0000000")

    will convert a value of 452 in cell A1 to 0000452.

    Is that what you need?

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How to add leading zeros?

    That only returns them. If you need to update the field....

    First, what is the datatype of the column? If it's numeric, then I'd suggest leaving it alone and using a...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How to add leading zeros?

    SELECT

    LEFT('0000000' + CAST(yourNumber AS VARCHAR(7)), 7) AS formattedNumber

    FROM

    ....

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Using Top(n) with CTEs

    And if you haven't used the ROW_NUMBER keyword, take a dive into it. I've found it to be pretty useful. :w00t:

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg

Viewing 15 posts - 886 through 900 (of 1,183 total)