Forum Replies Created

Viewing 15 posts - 76 through 90 (of 463 total)

  • RE: Obtain Values for Chart

    Remove that first group by value..

    SELECTCOUNT(dbo.LK_EXPHistory.Exp_High) AS High,

    COUNT(LK_EXPHistory.Exp_Low) AS low ,

    COUNT(LK_EXPHistory.Exp_Medium) AS medium,

    COUNT(LK_EXPHistory.Exp_None) AS [No Expreience],

    dbo.EXP_Area.Area,

    dbo.EXP_Category.Category

    FROM dbo.LK_EXPHistory

    INNER JOIN dbo.EXP_Category

    ON dbo.LK_EXPHistory.EXPCategoryID = dbo.EXP_Category.EXPCategoryID

    INNER JOIN dbo.EXP_Area

    ON...

    ---------------------------------------------------------------------------------

  • RE: Case When Then Error

    arun.sas (1/18/2010)


    Hi,

    What you have written in the statement is correct, but you should convert the date time type by convert (varchar (15), tet.dteTravelDate, 103)

    Not always, I guess it depends on...

    ---------------------------------------------------------------------------------

  • RE: Insert date plus 4 weeks

    that should work,

    SELECT dateadd(m, 1, getdate())

    What is the format that you are looking for?

    ---------------------------------------------------------------------------------

  • RE: Select a column not in Group By clause

    The query that Gsquared has suggested, (untested)

    ;WITH CTE (Title, Subject, row_no) as

    ( SELECT Title,Subject, Row_number() OVER(PARTITION BY Subject

    Order by price desc) as row_num

    FROM Book)

    Select * from...

    ---------------------------------------------------------------------------------

  • RE: First row skipped in cursor

    Dont you think you should be giving the variable names in your subsequent fetch also?

    FETCH RATES INTO @baseModID, @tmpRate

    (within your while loop)

    ---------------------------------------------------------------------------------

  • RE: SQL Query Help

    Yes I got it, Thanks for updating back 🙂

    ---------------------------------------------------------------------------------

  • RE: SQL Query Help

    I dont understand how 'A123456' would have 1 in total when there are no count in either modes

    Is this what you need?

    SELECT T1.ItemName,

    SUM(CASE WHEN Mode ='AAA' THEN 1...

    ---------------------------------------------------------------------------------

  • RE: SQL Server/Web Server Stopped in middle while executing procedue

    Depends (on the code) on the transactional blocks of your stored procedure.

    http://msdn.microsoft.com/en-us/library/ms190612(SQL.90).aspx

    ---------------------------------------------------------------------------------

  • RE: Convert Single from single record output to multi record

    Test data as suggested by SS but a 10000 feet view from my side is that you need an 'UNPIVOT'. Read this,

    http://technet.microsoft.com/en-us/library/ms177410(SQL.90).aspx

    ---------------------------------------------------------------------------------

  • RE: Trigger

    Depends on your knowledge level of database/sql. Anyway, to start with,

    I found a description in wikipedia, which goes like this,

    A database trigger is procedural code that is automatically...

    ---------------------------------------------------------------------------------

  • RE: multi-part identifier could not be bound

    or may be this? (untested as there is no test data)

    SELECT * INTO ##tmp_transaction

    FROM dbo.tr_transactions a

    Where a.scheme_id in (

    (SELECT DISTINCT scheme_id

    FROM dbo.tr_scheme_rates

    WHERE recalculate_transactions = 1

    AND (([start_date] < a.delivery_dtime) AND (end_date...

    ---------------------------------------------------------------------------------

  • RE: multi-part identifier could not be bound

    Dont you think you should be putting this after the ON clause ?

    AND (([start_date] < a.delivery_dtime) AND (end_date > a.delivery_dtime))

    ---------------------------------------------------------------------------------

  • RE: Preceding "N" character in SQL syntax

    Just to add to what tyson had to say,

    BOL

    Unicode strings

    Unicode strings have a format similar to character strings but are preceded by an N identifier (N stands for...

    ---------------------------------------------------------------------------------

  • RE: How to get data for whole month

    A case of dynamic cross tab or pivot i guess. Read this excellent article.

    http://www.sqlservercentral.com/articles/Crosstab/65048/

    ---------------------------------------------------------------------------------

  • RE: hex to decimal

    I dont think there is any in built function for that. (I could be wrong). Lets wait and see if someone has a better suggestion. Thanks.

    ---------------------------------------------------------------------------------

Viewing 15 posts - 76 through 90 (of 463 total)