Forum Replies Created

Viewing 15 posts - 2,116 through 2,130 (of 2,452 total)

  • RE: How to calculate the ADX

    Dear sushilb

    based on the spreadsheet you provided, I have taken the liberty to use this as the source for some sample data.

    Hopefully.........we can then start to see where your code...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Why is my SELECT query slower when the table is indexed?

    good to hear you have the testrig sorted now.

    so back to your original post

    However, upon conducting some tests using a simple single column query (I can provide the query and...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: How to calculate the ADX

    I am sorry but if i break your code out...I still get divide by zero errors...

    probably best if you can repost your set up scripts, with all the recent amendments...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: How to calculate the ADX

    sushilb (11/13/2011)


    I have commented the line which is giving the error

    what error messge are you getting please?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: How to calculate the ADX

    your set up script still throws error...it is looking for "EOD_NSE_Stock" in the proc.....please check your code before posting...

    ok... I change EOD_NSE_Stock to "NSE_Stock_Data"...now when I run this section

    SELECT

    ...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: How to calculate the ADX

    sushilb (11/12/2011)


    Sample data to test

    ----create the table NSE_Stock_Data run below query to get the data

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

    --drop table NSE_Stock_Data

    create table NSE_Stock_Data

    ..............................................................--

    Hi...by ADX can I assume you are talking...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Why is my SELECT query slower when the table is indexed?

    raotor (11/10/2011)


    J Livingston SQL (11/10/2011)


    take a look at my sample testrig earlier in this thread.

    I've copied your test script into SSMS and executed it. However, it appears to run extremely...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Why is my SELECT query slower when the table is indexed?

    take a look at my sample testrig earlier in this thread.

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Need help about writting a query:

    does this help...

    SELECT ID, Name, MIN(Update_date)

    FROM <YOURTABLE>

    GROUP BY ID, Name

    HAVING (COUNT(*) > 1)

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: How to modify code to display '21:30:00 PM' as '09:30:00 PM'?

    Jeff Moden (11/7/2011)


    adonetok (11/7/2011)


    The code below will display as '21:30:00 PM'

    How to modify code to display as '09:30:00 PM'?

    declare @date datetime

    set @date = '2011-11-08 21:30:00.000'

    select CONVERT(VARCHAR, @date, 108) +...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Are the posted questions getting worse?

    L' Eomot Inversé (11/7/2011)


    Gianluca Sartori (11/7/2011)


    Totally different topic: this thread asks how to format datetime values in T-SQL.

    I think this is a very bad habit to kick and I...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Tricky Calculation, Multiple Query?!?!

    agree with CC...if you need "total" as well

    select country,

    COUNT (level) as total,

    sum...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: How to modify code to display '21:30:00 PM' as '09:30:00 PM'?

    try this...hopefully it meets your specific requirements:

    declare @date datetime

    set @date = '2011-11-08 21:30:00.000'

    select convert(varchar,@date, 103) --- change 103 to 101 if mm/dd required

    + ' '

    + CONVERT(VARCHAR(30), Dateadd(HH, CASE WHEN...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: How can I improve this query? Need to Create Aggregates in One Step - Currently Create a Query and Subsequently Use a #Temp Table to Perform Summing and Grouping

    is this part of the code correct?...not sure this is what you want.

    CASE Datediff(mm, SaleTransferredTS, GetDate())

    WHEN 0 THEN 1

    ...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Union query displays multiple records after Group By

    ...ok, so assume you havent got a solution yet?

    can you post the table "create" script.....maybe we can generate some sample data for you.

    In SSMS...right click on your table > Script...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 15 posts - 2,116 through 2,130 (of 2,452 total)