Forum Replies Created

Viewing 15 posts - 661 through 675 (of 4,087 total)

  • RE: Sub queries In access

    I would take a different approach.  Your two queries are very similar.  Rewrite your query to pull any record that would meet either criteria and then use two CASE/IF expressions:...

  • RE: Filter by column that is datetime, so only rows that had a ref in time period show up

    I actually prefer using the first of the month to group dates. 

    • There is a fast way to determine the first of the month for any date.
    • You can...
  • RE: Increment dates for a set of records

    barry.nielson - Tuesday, February 12, 2019 3:17 PM

    Hi Drew,

    Gee, thanks so much for the effort here.  Much appreciated.

    I am using SQL 2008...

  • RE: How can I write this query?

    You can simplify this by using a different default value for the lag function.


    WITH LAG_DATA AS (

        SELECT
            TT.rn,
            TT.dt,
            TT.[status],
           ...

  • RE: Converting Varchar to Date

    You can also use TRY_CAST() or TRY_CONVERT() to identify which records have issues.  Each of these will produce a NULL value instead of an error when the conversion fails.

  • RE: SQL Script

    Luis Cazares - Wednesday, February 13, 2019 8:32 AM

    This is a very expensive way of doing it. Unpivoting and pivoting the...

  • RE: Increment dates for a set of records

    It's not quite in the format you asked for, but it can easily be tweaked.

    CREATE TABLE #Customer_Balances
    (
        Customer_ID        INT
    ,   Cur_Balance        MONEY
    ,   As_of_Date       ...

  • RE: Using Computed Columns

    thisisfutile - Tuesday, February 12, 2019 12:54 PM

    drew.allen - Tuesday, February 12, 2019 12:26 PM

  • RE: Using Computed Columns

    thisisfutile - Tuesday, February 12, 2019 11:57 AM

    We have a database that is filled with tables utilizing an integer column for things...

  • RE: Using Computed Columns

    Mike D - Tuesday, February 12, 2019 7:55 AM

    Why not use a view for computed columns? Is this not clearer?

    I...

  • RE: Dynamic SQL to iterate through consecutively named columns?

    I see nothing here that argues for a dynamic approach.  Post sample data and expected results, and we should be able to help you come up with an approach that...

  • RE: SQL Script

    You also need to specify the logic used to determine which values appear together.  NOTE: Tables represent sets, which are unordered.  The display order is not a valid option.

  • RE: Multilayer Hierarchy

    Paul Giles-Randall - Friday, February 8, 2019 7:15 PM

    I think the drawing  lost some depth.
    So I have tried to add it again.

    [CompanyId](Display:...

  • RE: insert from an Excel linked server did not enforce table constraints

    Excel does not have a NULL value.  It has a BLANK value which is equivalent to ''.  When '' is converted to numeric, it is converted as 0.  You may...

  • RE: Normalizing redundant data (is this 1NF, 2NF or 3NF)

    michael.leach2015 - Wednesday, February 6, 2019 12:04 PM

    My questions are:

    1.  Regarding the act of breaking out the department details what is this...

Viewing 15 posts - 661 through 675 (of 4,087 total)