Forum Replies Created

Viewing 15 posts - 16 through 30 (of 45 total)

  • RE: Usage Query

    Eric M Russell (8/24/2015)


    maxlezious (8/24/2015)


    Eric M Russell (8/24/2015)


    maxlezious (8/24/2015)


    Thanks for your reply!

    I currently have a job setup which runs the stored procedure every week and inserts the usage figures in...

  • RE: Usage Query

    Luis Cazares (8/24/2015)


    And if you don't need the time, just use the date datatype instead of a datetime.

    Thank you, will change to 'date' datatype as wont be needing time.

  • RE: Usage Query

    Eric M Russell (8/24/2015)


    maxlezious (8/24/2015)


    Thanks for your reply!

    I currently have a job setup which runs the stored procedure every week and inserts the usage figures in a table. All i...

  • RE: Usage Query

    Thanks for your reply!

    I currently have a job setup which runs the stored procedure every week and inserts the usage figures in a table. All i am looking for is...

  • RE: Help with T-Sql

    I have the Microsoft SQL Server 2014 Query Tuning & Optimization and I will lookup on the other books you mentioned - thank you

    I have been a silent reader of...

  • RE: Help with T-Sql

    Really hope I become as good as you soon. Would you recommend me any t-sql books or just practicing on daily basis?

  • RE: Help with T-Sql

    Absolute star, i am your fan now. Thank you again 🙂

  • RE: Help with T-Sql

    Chris, I am sorry to bother you again. I am trying to fiddle with the query you gave me to sum up the ajars and motions in same row

    For example:

    In...

  • RE: Help with T-Sql

    Thank you so much for the updated query Chris. That's is exactly what I was after, really appreciate your time and help with the query.

  • RE: Help with T-Sql

    ChrisM@Work (8/18/2015)


    Here's a halfway point:

    SELECT

    a.*,

    x.[hours],

    Points = COUNT(*) OVER(PARTITION BY a.ActType, x.[hours]) * x.points

    FROM #tblActivities a

    CROSS APPLY (

    SELECT

    [hours] = CASE

    WHEN a.ActType = 'Motion' THEN DATEPART(HOUR, a.isoTimeStamp)...

  • RE: Help with T-Sql

    ChrisM@Work (8/18/2015)


    Excellent job on putting together sample data. Can you post up what you expect your output to look like? Cheers.

    Hi, Thank you for your reply. I am expecting the...

  • RE: Help with COUNT function in the query

    Thats exactly what i needed. Thank you so much! 🙂

  • RE: Need help with CASE

    Thank you for your great advice Lynn, I will create a new stored procedure like you adviced.

  • RE: Need help with CASE

    Is this correct way to do it

    DECLARE @clientname VARCHAR (60)

    SELECT DISTINCT @clientname = ClientName

    FROM tblClient

    WHERE ClientNumber

    IN

    (SELECT ClientNumber FROM tblSystem WHERE SystemNum = @systemID)

    SELECT CASE

    ...

  • RE: Need help with CASE

    Thanks for your reply Lynn.

    We have this working php code and i am trying to convert this into sql

    $db_name = "DB_admin1" ;

    $conn = mssql_select_db($db_name) or die('Connection to the Database failed!

    ')...

Viewing 15 posts - 16 through 30 (of 45 total)