Forum Replies Created

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

  • Reply To: ? on Count specific value on XML data

    Sorry, I was trying not to show some data

    here is a samle I found and changed, so lets say in this example I want counts of name

    <Employees>

    <Person>

    <ID>1000</ID>

    <minor>yes</minor>

    </Person>

    <Person>

    <ID>1001</ID>

    <minor>yes</minor>

    </Person>

    <Person>

    <ID>1002</ID>

    <minor>yes</minor>

    </Person>

    <Person>

    <ID>1003</ID>

    <minor>no</minor>

    </Person>

    </Employees>

    So I would like...

  • Reply To: ? on Count specific value on XML data

    Thnaks and sorry for not adding this

    So in this example I would want Black 2 and red 1

    <Data>

    <Others>

    <members>

    <Name>adf</Name>

    <Color>red</Minor>

    </members>

    <members>

    <Name>adf</Name>

    <Color>black</Minor>

    </members>

    <members>

    <Name>adf</Name>

    <Color>black</Minor>

    </members>

    </Others>

    </Data>

  • Reply To: SQLServer won't start?

    Thanks for getting back...

    The only way I know to get to the logs is via SSMS  connecting to the DB which it won't do.

    Is there another way?

     

  • Reply To: ? on Setting default value to Year of previous month

    Thanks Steve, thats a bit more straightforward 🙂

  • Reply To: ? on Setting default value to Year of previous month

    It's funny, when you see something in print, you get it....

    I came up with

    =Format(DateAdd(DateInterval.Month, -1, Today), "yyyy")

     

    And it works!!!

    Thanks

     

     

  • Reply To: Carriage Return in a STUFF Statement ??

    Thanks Everyone for the tips,

    I kind of hacked it up a bit....

    Changed the CHAR13 to a "&" encompassed the STUFF in a LEFT command to subtract the last "&"

    Then in...

  • Reply To: Carriage Return in a STUFF Statement ??

    Thanks for getting back, I'm using SSRS , the output looks the same, maybe something I need to format in the textbox?

     

  • Reply To: Parse only specific part of XML field?

    That worked great!

    I just used

    CAST(data.value('(/Data/Time_x0020_of_x0020_Call)[1]', 'varchar(30)') AS TIME) AS TimeofCall

    Thank Again

  • Reply To: Parse only specific part of XML field?

    So the field looks like this

    <Data>

    <Client_x0020_Phone_x0020_Number>1-cell-phone</Client_x0020_Phone_x0020_Number>

    <Time_x0020_of_x0020_Call>2020-06-22T09:00:00-04:00</Time_x0020_of_x0020_Call>

    <Time_x0020_of_x0020_Disposition>2020-06-22T10:00:00-04:00</Time_x0020_of_x0020_Disposition>

    <Family_x0020_Resource_x0020_Worker>famresworker</Family_x0020_Resource_x0020_Worker>

    <Family_x0020_Resource_x0020_Worker_x0020_Phone>1-fam-res-phone</Family_x0020_Resource_x0020_Worker_x0020_Phone>

    </Data>

    So why does

    SELECT

    data.value('(/Data/Client_x0020_Phone_x0020_Number)[1]', 'varchar(30)') AS ClientPhone,

    data.value('(/Data/Time_x0020_of_x0020_Call)[1]', 'Time') AS TimeofCall,  ....

    have output of  "13:00:00.0000000"

     

    thanks

     

  • Reply To: ? on Non-Clustered Indexes

    Thank you....

     

  • Reply To: ? on Non-Clustered Indexes

    Thank You...

     

    This is great information to have.....

  • Reply To: ? ON Parsing an XML Field

    Thank you  for the info, I get it now!!! sort of...:) bit more understanding on my part, but I see how to do it

     

    Thank You Again

     

  • Reply To: calc/group data by week for date range ?

    It definitely gives me a starting point to start working

    I have actually never use cursor or a while(in sql anyway) yet. But will look into it

    It for the most part...

  • Reply To: Create Stored Procedure to create Indexes?

    To be honest the vendor won't tell use. It is transaction replication  for reporting

    All I know is they won't turn on nonclustered inxedes in replication

    thus the recreation each night

  • Reply To: Create Stored Procedure to create Indexes?

    USE [Database];
    GO

    /****** Object: StoredProcedure [dbo].[Non-Clustered_Indexes] Script Date: 4/16/2020 4:34:21 PM ******/

    SET ANSI_NULLS ON;
    GO
    SET QUOTED_IDENTIFIER ON;
    GO
    CREATE PROCEDURE [dbo].[Non-Clustered_IndexesB]
    AS
    BEGIN
    ...

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