Forum Replies Created

Viewing 15 posts - 106 through 120 (of 394 total)

  • RE: need urgent help on a calculation

    Try this...

    --== TEST DATA ==--

    SET DATEFORMAT DMY -- Assumes 09 = day, 01 = month

    DECLARE @testing AS TABLE (

    TargetStartDate DateTime,

    TemporaryAssignmentEndDate nvarchar(255)

    )

    INSERT INTO @testing VALUES ('01 Aug...

  • RE: Need help with a query

    Try this:

    DECLARE @testing AS TABLE (

    AgentID INT,

    ExcepCodeDetailName VARCHAR(10),

    Detail_Start_Time DATETIME,

    Detail_End_Time DATETIME

    )

    INSERT INTO @testing (AgentID, ExcepCodeDetailName, Detail_Start_Time, Detail_End_Time) VALUES (12345, 'Break', '2013-08-06 09:00:00', '2013-08-06 09:10:00')

    INSERT INTO

  • RE: SSRS Report Parameters - Multi Select

    You can use Jeff Moden's 8K splitter (from this site) to create a table object containing the comma-separated values & then inner join this to the query to filter the...

  • RE: Bizarre 'divide by zero' - no division happening!

    If it's an import process, are you inserting rows on a table with a trigger that divides something?

  • RE: need help with applying function within Query

    Try this:

    SELECT

    HST_Currents.Timestamp_ID, Devices.name, Topics.short_name, Topics.name AS Expr1, Topics.short_units, Topics.description,

    HST_Currents.Original_Value,

    convert(varchar, DATEADD(s,(HST_Currents.Timestamp_id - 624511296000000000) / 10000000,'19800101'), 126) AS TimeStampDateTime

    FROM Devices INNER JOIN

    HST_Currents ON Devices.local_Device_ID = HST_Currents.Device_ID INNER JOIN

    LoggedItems ON Devices.local_Device_ID =...

  • RE: Can someone tell me what is wrong in this query: I get error Msg 102, Level 15, State 1, Line 1 Incorrect syntax near

    Syntax should be like this:

    insert into [e_onenew].[dbo].[Users]

    (

    [User_Id],

    [Customer_Id],

    [User_Name],

    [Preferred_Name],

    [Email],

    [Mobile_Phone_1],

    [Mobile_Phone_2],

    [Mobile_Phone_3],

    [Phone_1_Status],

    [Phone_2_Status],

    [Phone_3_Status],

    [Password],

    [REMINDER_QUESTION],

    [REMINDER_ANSWER],

    [Registration_Date],

    [Registered_By],

    [Approval_date],

    [Approved_by],

    [Last_UpdateD],

    [Last_Updated_By],

    [Last_Sign_On_Tel],

    [Last_Sign_On_SMS],

    [Last_Sign_On_IB],

    [Status],

    [approved],

    [block],

    [TryCount],

    [user_flg],

    [ex_flg]

    )

    SELECT [User_Id],

    [Customer_Id],

    [User_Name],

    [Preferred_Name],

    [Email],

    [Mobile_Phone_1],

    [Mobile_Phone_2],

    [Mobile_Phone_3],

    [Phone_1_Status],

    [Phone_2_Status],

    [Phone_3_Status],

    [Password],

    [REMINDER_QUESTION],

    [REMINDER_ANSWER],

    [Registration_Date],

    [Registered_By],

    [Approval_date],

    [Approved_by],

    [Last_UpdateD],

    [Last_Updated_By],

    [Last_Sign_On_Tel],

    [Last_Sign_On_SMS],

    [Last_Sign_On_IB],

    [Status],

    [approved],

    [block],

    [TryCount],

    [user_flg],

    [ex_flg]

    from [e_one].[dbo].[Users]

  • RE: Database Naming Convention

    I've never seen any convention on this. It's best to give a DB a short meaningful name with no spaces. Sometimes DB names may be for example suffixed...

  • RE: select distinct rows

    SELECT DISTINCT will only drop rows where all column values in the select statement are the same as another row. None of your sample rows matches any other, so...

  • RE: Today's Random Word!

    ChrisM@Work (7/30/2013)


    JAZZ Master (7/30/2013)


    Revenant (7/30/2013)


    L' Eomot Inversé (7/29/2013)


    crookj (7/29/2013)


    sing4you (7/29/2013)


    L' Eomot Inversé (7/29/2013)


    The Dixie Flatline (7/29/2013)


    JAZZ Master (7/29/2013)


    Daniel Bowlin (7/29/2013)


    ache

    pain

    gain

    loss

    profit

    Seer

    Sear

    Sears

    Craftsman

    Crofter

    Bonxie

  • RE: help with query

    Yopu can user ROW_NUMBER() to do this - something like this:

    select *

    from

    (

    select

    row_number() over (partition by item order by version desc) as xrow,

    version,

    ...

  • RE: multipart identifier could not bound

    Is your real query more complicated than this?

    If so, the table alias you're using could be out of scope.

    If you post the query we can take a look at it.

  • RE: Distinct Keyword

    If you use DISTINCT it will remove rows from the result set where all selected columns are equal. In this case, the Stack Id is the same but the...

  • RE: Dynamic WHERE statement if stored procedure parameter is null

    Have you tried dynamic SQL?

    Something like this:

    declare @sql nvarchar(max),

    @Startdate nvarchar(10),

    @Enddate nvarchar(10);

    set @sql = 'select * from #table1';

    set @Startdate = '01/01/1900';

    set @Enddate = '01/01/1900';

    if @Startdate is not...

  • RE: What was erroe in my code?

    It's so full of spelling errors it's difficult to say

    e.g. 'priamrykey' in users table definition won't compile.

    Can you correct the typos & give a bit more detail about the error?

Viewing 15 posts - 106 through 120 (of 394 total)