Forum Replies Created

Viewing 15 posts - 31 through 45 (of 94 total)

  • RE: How to search exact word using LIKE operator?

    how do you delete a post?

  • RE: How to search exact word using LIKE operator?

    btw guys, how do you know if someone replied to you in a forum or posted something in the same forum you posted? I mean do you have any notifications...

  • RE: How to search exact word using LIKE operator?

    Hi there,

    I just changed your where clause...

    I hope this helps ^__^

    Declare @name varchar(100)

    set @name = 'count'

    SELECT c1

    FROM mytbl2

    WHERE c1 LIKE '%' + @name + '%'

    AND c1 NOT LIKE '%[A-Z]'...

  • RE: Can this CTE based query be written more efficiently?

    Hi there,

    ^__^ I hope this helps

    DECLARE @tbl TABLE (TransactionID INT,Code CHAR(3),Num INT, DateTimeReceived DATETIME)

    INSERT INTO @tbl

    SELECTpkTransactionID

    --,ComponentText

    ,LEFT(ComponentText,3)

    ,RIGHT(ComponentText,LEN(ComponentText)-3)

    ,DateTimeReceived

    FROM ##Temp1

    SELECTDISTINCT

    tot.TransactionID

    ,tot.NumAS 'TOT'

    ,UniqueEnvs = gbx.Num + iex.Num + unk.Num

    ,gbx.NumAS 'GBX'

    ,iex.NumAS 'IEX'

    ,unk.NumAS 'UNK'

    ,tot.DateTimeReceived

    FROM @tbl tot

    INNER JOIN...

  • RE: Maximum Date that exists for two or three parties and also another table

    Hi there,

    Just wanna try out my solution ^__^

    SELECT @date=t1.[date]

    FROM @Table1 t1

    INNER JOIN @Table2 t2 ON (t1.[date]=t2.[date])

    GROUP BY t1.[date]

    HAVING COUNT(name)=(

    SELECT COUNT(DISTINCT Name)

    FROM @Table1 t1

    INNER JOIN @Table2 t2 ON (t1.[date]=t2.[date]))

  • RE: Need simple way (using t-sql) to generate "realistic"-looking numbers...

    I agree with Eric

    SELECT CAST((RAND()*1000000000) AS INT)

    since you said no "-"

    but if it includes dashes like lowell's example, thi is my code

    DECLARE @i INT

    SET @i=1

    DECLARE @tbl TABLE (SSN NVARCHAR(11))

    WHILE @i<=1000

    BEGIN

    INSERT...

  • RE: I can't create a database T__T

    😀 Man, I love you guys!!!

    Thanks!

    :)Hi sqlizer, i tried the rightclick then open as administrator... :w00t:IT WORKED ^__^ Wohooo!!! Thanks!!!:hehe:

    Thanks Guys!!! ^__^

    :w00t:Merry Christmas and a Happy New year to you...

  • RE: Stored Procedure to query many tables

    :)Hi there,

    Uhmmmm... Why not use one table instead of 44?

    Example:

    Hope this helps... ^__^

    Create Table MyTable

    (

    IDINTIDENTITYNOT NULL,

    Item1VARCHAR(MAX)NOT NULL,

    Item2VARCHAR(MAX)NOT NULL,

    DateDATETIMENOT NULL

    )

    --Now, if we want to view a particular Year and Month, We...

  • RE: SQL Query in table field

    Hi there,

    Hope this helps...

    First lets create some sample data...

    CREATE TABLE SprocTable

    (

    IDINTIDENTITY,

    SprocVARCHAR(MAX)

    )

    GO

    CREATE PROC USP_Hi

    AS

    SELECT 'Hi'

    RETURN

    GO

    CREATE PROC USP_Hello

    AS

    SELECT 'Hello'

    RETURN

    GO

    INSERT INTO SprocTable

    SELECT 'USP_Hi'

    UNION

    SELECT 'USP_Hello'

    SELECT * FROM SprocTable

    like so...

    Now lets execute our sproc

    DECLARE @sproc...

  • RE: Count between two days

    Hi there,

    Hope this helps... By the way, is the excel sample data from Excel or from SQL?

    If from SQL, try this one...

    DECLARE @EndDate DATETIME, @StartDate DATETIME

    SELECT @StartDate=[Column_A] WHERE [Column_C]='S'

    SELECT @EndDate=[Column_A]...

  • RE: Issue with stored procedure...

    Hi there,

    I think your problem is here

    EXEC dbo.eProcedure @value1,@eValue OUTPUT

    Can you post the code that you used for this sproc. Its either the parameters for @Value in...

  • RE: Procedure

    :DLOL

    :PI forgot to explain...

    :)The Stored procedure expects inputs for ALL its parameters unless they have DEFAULT values...

    :w00t:By the way, it's best to use my first example, It easier to do...

  • RE: Procedure

    Hi there,

    Hope this helps

    DECLARE

    @taxCode varchar(100),

    @Qty numeric(19,6),

    @Price numeric(19,6),

    @dis numeric(19,6),

    @AssessableValue numeric(19,6)

    SELECT

    @taxCode = '123',

    @Qty = '123'),

    @Price = '123',

    @dis = '123',

    @AssessableValue = '123'

    EXEC tax

    @taxCode varchar(100),

    @Qty numeric(19,6),

    @Price numeric(19,6),

    @dis numeric(19,6),

    @AssessableValue numeric(19,6)

    -- OR

    EXEC tax

    @taxCode = '123',

    @Qty =...

  • RE: Isnull and count for a particular day

    :DHi there,

    :PSorry this came late, I have no network connection last friday and I'm ofline during saturdays and sundays...

    :hehe:Anyway, regarding your question... Are you talking about this one?

    WHERE CONVERT(VARCHAR(MAX),GETDATE(),103)=CONVERT(VARCHAR(MAX),Date,103)

    You see...

  • RE: Time between dates in business hours

    Hi there,

    Hi there,

    This isn't the exact answert but i hope it helps

    For 8 working hours per day...

    SELECT DATEDIFF(mm,GETDATE(),'12/12/12') * 8

    If your talking about Monday-Friday only, that's a different query

    It would...

Viewing 15 posts - 31 through 45 (of 94 total)