Forum Replies Created

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

  • RE: Where clause not working

    The following SQL returns 'BBBBBB' and 'CCCCCC', the customers that are in the customer table but not in the DR table.

     

    declare @master-2 Table (customer varchar(20))

    declare @Customer Table (customer varchar(20))

    declare @DR...

  • RE: Where clause not working

    By adding 'WHERE DR.CUSTOMERNUMBER IS NULL' to the select it will only return rows not in the DR table because for rows that are in the DR table and in...

  • RE: Find numeric match from a variable length value set

    Try this if table1 has multiple rows in it and you need the longest for each row:

    declare @Table1 Table(value varchar(14))

    declare @Table2 Table(value varchar(12))

    insert @Table1 Values('1216574754745')

    insert @Table1 Values('1216575854745')

    insert @Table1 Values('1219905854745')

    insert @Table1...

  • RE: Find numeric match from a variable length value set

    Try this:

     

    declare @Table1 Table(value varchar(14))

    declare @Table2 Table(value varchar(12))

    insert @Table1 Values('1216575854745')

    insert @Table2 Values('1')

    insert @Table2 Values('121')

    insert @Table2 Values('1216')

    insert @Table2 Values('121657')

    insert @Table2 Values('1216574')

    insert @Table2 Values('12165747')

    select top 1 *

    from @Table1 t1

    inner join @Table2...

  • RE: Where clause not working

    You should use LEFT OUTER JOINS for this purpose

    An example of the query is:

    INSERT INTO DR

    SELECT  m.customer,

    ...

    FROM dbo.Master m (NOLOCK)

    INNER JOIN dbo.Customer...

  • RE: Inventory accumulative fields

    I believe part of your message was cut off.  Could you repost the complete question?

     

  • RE: Refrence Input Param-Brain Farting I suppose

    You need to use either

      SELECT @F_NM=@F_NM + '%'

    OR

      SET @F_NM=@F_NM + '%'

  • RE: weekly Duplicate checking

    One thing to do is to store the SOUNDEX of each row as a column.  Also, store the stripped down names as colums.  It's easier to amortize the cost of...

  • RE: SQL Server 2000 won''''t check stored procedure semantics anymore

    SQL Server does this by design to allow some objects to be created after other objects.  What SQL Server does when created an object, if any reference object exists, the...

  • RE: Parse Varchar Field

    This won't create a table with 1 row for each incorrect answer.  The output may look like what is desired but this is only a function of Query Analyzer.

  • RE: Help me with a query

    Try something like this using your table definitions:

    select cast(createdate as varchar) as 'Data'

    from syslogins

    where name = 'sa'

    union

    select cast(language as varchar)

    from syslogins

    where name = 'sa'

    union

    select cast(status as varchar)

    from syslogins

    where name...

  • RE: weekly Duplicate checking

    Try looking at the SOUNDEX and DIFFERENCE functions.

    --Jeff

  • RE: Using A Stored Procedure instead of writing out SQL Statements

    The value of 'adCmdStoredProc' should be defined in the file 'adovbs.inc' and the declaration should be: Const adCmdStoredProc = &H0004.  It tells ADO what type of statement is being executed, in...

  • RE: Help with a Cursor... yes..

    Looking at the code, there are several things that I would do differently.

    One, the first cursor, SCHOOLNUM2_CURSOR, loops through the table and resets the variable @STARTDATE to one of two values. ...

  • RE: How do I go through a table with a timestamp column and determine the accumulated time of certain records

    If by tally, you mean the total number of seconds that each type of event takes then the following should work:

    declare @events table (EventTime datetime, Event char(4))

    insert @Events values ('8:23:00','GOOD')

    insert @Events...

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