Forum Replies Created

Viewing 15 posts - 3,121 through 3,135 (of 3,480 total)

  • RE: SQL Query

    remove all the (nolock) hints.

  • RE: Help query

    Good thing, because I was just starting to think about it and try to figure out a solution (Good learning exercise, but if you have actual work to do, not...

  • RE: Help query

    Probably the easiest way would be to use a query of one of the system tables and see if you can match that way...

    use MyDb;

    go

    DECLARE @TableName VARCHAR(25);

    SET @TableName = 'Hospital';

    Select...

  • RE: Is there a way to generate a list of dates based on date ranges in another table?

    Is this close? Note, as Craig mentioned, you need a Tally table to do this.

    Here's his code for creating one:

    http://www.sqlservercentral.com/scripts/Advanced+SQL/62486/

    use TEMPDB;

    go

    DROP TABLE #Parts;

    GO

    CREATE TABLE #Parts (

    RecKey INT,

    Part CHAR(2),

    LT INT,

    StartDate...

  • RE: Big transaction log file

    Yes, But SQL Saturday was last month...

  • RE: Syntax Error with Multi-Table Joins

    Yep, makes it MUCH easier to see what you were doing wrong. Way to go, young Jedi.

  • RE: CommandShellLogin

    You could do it inside a stored procedure, and then grant the right to execute said stored procedure to whoever you wanted. You could add EXECUTE AS <user> inside...

  • RE: Syntax Error with Multi-Table Joins

    The problem is that you left out the other INNER JOIN statements:

    ...

    FROM

    vt_animals as A

    INNER JOIN

    vt_exam_headers as EH...

  • RE: Access 2010 and MS SQL Server 08 r2

    You might want to see if you can find the last version of Access Developer's Handbook, Enterprise Edition The first volume is Desktop, and you don't want that, I...

  • RE: SSRS Expressions

    Something like....

    DECLARE @TextString VARCHAR(100) = 'ACCOUNTANTS:- Signal Chartered Accountants @@ Individual:Mark John-Wilkinson';

    DECLARE @StartPos INT,

    @EndPos INT;

    SELECT @EndPos = CHARINDEX('@@',@TextString);

    SELECT @StartPos = CHARINDEX(':-',@TextString)+2;

    PRINT @StartPos;

    PRINT @EndPos;

    SELECT RTRIM(LTRIM(SUBSTRING(@TextString,@StartPos,@EndPos-@StartPos)));

    Returns:Signal Chartered Accountants

    You should be able...

  • RE: FINDING THE DATE WHICH IS NEAREST TO CURRENT DATE

    This is a double-post... here's the original

  • RE: Two results

    Wouldn't OR'ing the two filters together do it?

    SELECT i.Configurtation_Item, COUNT(i.ID) AS CountID, I.Sub_Category

    FROM ConfigIssues AS i

    WHERE Configuration_Item LIKE '%outlook%' AND (Sub_Category LIKE '%Emails %' OR Sub_Category LIKE '%Managers %')

    GROUP BY...

  • RE: Two results

    Wouldn't OR'ing the two filters together do it?

    SELECT i.Configurtation_Item, COUNT(i.ID) AS CountID, I.Sub_Category

    FROM ConfigIssues AS i

    WHERE Configuration_Item LIKE '%outlook%' AND (Sub_Category LIKE '%Emails %' OR Sub_Category LIKE '%Managers %')

    GROUP BY...

  • RE: FINDING THE DATE WHICH IS NEAREST TO CURRENT DATE

    sure enough... must be getting old... forgot that my Tally table is indexed, so that caused me to overlook it.

    Definitely need an ORDER BY clause! TOP VALUES without an...

  • RE: FINDING THE DATE WHICH IS NEAREST TO CURRENT DATE

    Here's an example... I'm just creating a bunch of dates from a table of numbers.

    SELECT TOP 1 SomeDate, N

    FROM

    (SELECT DATEADD(dd,n,'1-1-2010') AS SomeDate, n

    FROM dbo.Tally) x

    WHERE SomeDate<=GETDATE();

    What you want is...

Viewing 15 posts - 3,121 through 3,135 (of 3,480 total)