Forum Replies Created

Viewing 15 posts - 841 through 855 (of 1,923 total)

  • RE: SQL script Help

    If your answer is YES for Dan's question, you might want to add AND T1.CilentID = T2.ClientID along with the T1.ROW = T2.Row+1 clause afterOUTER APPLY statement.

    Hope that...

  • RE: SQL script Help

    Not an efficient solution, but does what you requested for

    ; WITH CTE AS

    (

    SELECT T1.Row

    , T1.TransactionStatus

    , T1.TransactionType

    , CASE WHEN OutApp.TransactionStatus = 3 THEN 0

    ELSE T1.VALUE

    ...

  • RE: Returning multiple fields in a subquery based on each row of the master query.

    How about this?

    ; WITH CTE AS

    (

    SELECT SELL.*, BUY.COST , BUY.TAXES , BUY.DATE BUY_DATE

    , RN = ROW_NUMBER() OVER( PARTITION BY BUY.VEHICLE ORDER BY BUY.DATE DESC)

    FROM #SELL SELL

    INNER JOIN...

  • RE: Regarding Caledenr recurrance due date retreival

    I have been planning to write the code for this requirement since i saw this thread. But time dint permit me. But now, it has 😀

    Lets first set-up the test...

  • RE: Need advice on returning data based on specific day and time ranges

    Something like this?

    SELECT * FROM YOURTABLE

    WHERE

    ( DAY(YOURCOLUMN) IN ( 2, 3, 4, 5 ,6) AND YOURCOLUMNTIME BETWEEN '10' AND '6' )

    ...

  • RE: long date format

    Try this then:

    DECLARE @Date DATETIME = GETDATE()

    SELECT CASE LEFT( CONVERT(VARCHAR(50),@Date,107),3)

    WHEN 'Jan' THEN REPLACE( CONVERT(VARCHAR(50),@Date,107) ,'Jan' ,'January')

    ...

  • RE: long date format

    isnt that what you wanted?

  • RE: long date format

    Like this:

    DECLARE @Date DATETIME = GETDATE()

    SELECT CONVERT(VARCHAR(50),@Date,107) DayInWords

  • RE: Help a T-SQL Newbie

    How abt this?

    DECLARE @Date DATETIME = GETDATE()

    DECLARE @DatePart INT = DATEPART(WEEKDAY , @DATE)

    ; WITH Numbers (N) AS

    (

    ...

  • RE: Querying XML to display values in table format

    How about this?

    Declare @TheXMLCol XML =

    cast( '<RegMultiStringLists> <RegMultiStringList Name="Type" KeyPath="" KeyFlag="0"> <Value>msdrm.dll</Value> <Value>CIAgent.DLL</Value> <Value>CIStore.DLL</Value> ...

  • RE: SQL version & build?

    Like this:

    select SERVERPROPERTY('ProductVersion' ) as version

    , SERVERPROPERTY('Edition' ) As Edition

    , SERVERPROPERTY('EngineEdition') As EngineEdition

    , SERVERPROPERTY('MachineName' ) AS MachineName

    , SERVERPROPERTY('ProductLevel' ) AS ProductLevel

    , SERVERPROPERTY('ServerName' ) AS ServerName

  • RE: SQL version & build?

    Look up SERVERPROPERTY function; that will give u every detail abt your installation

  • RE: how to get odd data using SQL query

    this is not enuf.. We need sample data and expected output.. and your business process to arrive at the expected output..

  • RE: how to get odd data using SQL query

    What according to you is odd data? provide sample data, sample table structure as CREATE TABLE script and most importantly, your expected output..

  • RE: T-SQL PROBLEM

    Try this:

    declare @WSUrid numeric

    declare @WSUrnam varchar (100)

    declare @WSPrice1 varchar (100)

    declare @WSPrice2 numeric

    declare @WholesalePrice decimal...

Viewing 15 posts - 841 through 855 (of 1,923 total)