Forum Replies Created

Viewing 15 posts - 91 through 105 (of 2,452 total)

  • RE: Combinations question with a twist

    with the 56 rows in your sample data...to cover all possible combinations will generate 72 057 594 037 927 935 rows  (2^(56) -1) ....:w00t::w00t:

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Introduce rows for ROW_NUMBER Solution

    Johnny D - Wednesday, August 9, 2017 5:19 AM

    Thanks J Livingstone. 

    You sure are a SQL Champion. I had a feeble effort myself...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Introduce rows for ROW_NUMBER Solution

    just a word of caution here....the solution is using MAX(ref) ...which works for your data as posted....but consider the following data. This does not deliver the "previous row"

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Introduce rows for ROW_NUMBER Solution

    a helping hand 😀  (courtesy of http://www.convertcsv.com/csv-to-sql.htm  ...simple cut and paste !)

    CREATE TABLE #yourdata(
     USERID  INTEGER NOT NULL
    ,StartDate DATETIME...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Dynamic date range

    http://www.sqlservercentral.com/blogs/lynnpettis/2009/03/25/some-common-date-routines/

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: INSERT statement to pickup Special ID number

    briancampbellmcad - Friday, August 4, 2017 1:15 PM

    I have a weird problem. I have an Access database that has a table that...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Fuzzy Search

    any links to code/data sources to generate this 1 million row "Names" table please?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Update NULL values - SQL Help

    kishoremania - Wednesday, August 2, 2017 11:47 AM

    Hello Everyone, 

    Need some help in updating one column, I come up with some sample data.

    Create...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Create a table and join it with another existing table

    JohnDoe564 - Wednesday, August 2, 2017 9:43 AM

    ok I see,
    I have some other limitations which deny me from using  a regular join
    Anyway...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Display members with active cards

    maybe....

    CREATE TABLE #somedata(
     ID  INT
     ,CN  INT
    ,Cstatus VARCHAR(8)
    );
    INSERT INTO #somedata(ID,CN,Cstatus) VALUES
    (1,1001,'active'),(2,1002,'inactive'),(3,1003,'active'),(3,1004,'inactive')
    ,(4,1005,'active'),(4,1006,'active'),(5,1007,'inactive'),(5,1008,'inactive');

    WITH statuses as
    (  SELECT ID,

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Display members with active cards

    JohnDoe564 - Sunday, July 30, 2017 3:27 AM

    Hi guys,

    I have a little complicated issue,
    I want to display all the members in the...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: How to get lastest active record near to getdate

    maybe....

    WITH ndate
      AS (SELECT *,
          ROW_NUMBER() OVER(PARTITION BY ins_id ORDER BY ABS(DATEDIFF(day, end_date, @thedate))) rn
       FROM #temp)
      SELECT *
      ...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: combine query

    without seeing sample data ...here;s a best guess sample idea

    CREATE TABLE #yourdata(
     PID INT
    ,tdate DATETIME
    ,tdesc VARCHAR(8)

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculated Query Help

    gazy007 - Thursday, July 27, 2017 9:30 AM

    Does it help?

    CREATE TABLE mytable(
     ProductName  VARCHAR(7) NOT NULL PRIMARY KEY
    ,Description  VARCHAR(20) NOT NULL
    ,SalesOrderNumber...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Next row begins

    cbrammer1219 - Thursday, July 27, 2017 8:00 AM

    Thank You for your assistance, with a little tweaking I think I can get the...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 15 posts - 91 through 105 (of 2,452 total)