Forum Replies Created

Viewing 15 posts - 2,941 through 2,955 (of 3,544 total)

  • RE: How to select date based on range period.

    Depends on the input format. I prefer to convert input to dates first and then compare. You will have to convert anyway.

    set @from = year1...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Convert Nvarchar to Datetime

    quote:


    I hate dates in sql


    Hey! Come on chaps, a bit tongue in cheek here.

    I do...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Running a stored proc on table results

    Nice one Jonathan, will have to remember that one

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Convert Nvarchar to Datetime

    Oops!

    My apologies

    I hate dates in sql

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Running a stored proc on table results

    Your query will result in null because you have not initialized @mail, use

    set @mail = '' 

    or simply do this

    set...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Convert Nvarchar to Datetime

    quote:


    SET DATEFORMAT dmySELECT KeyCol, DateColFROM YourTableWHERE ISDATE(DateCol) = 0


    Jonathan,

    Depends on language settings, eg

    English

    2003-11-15 1

    2003-15-11...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: How to format DateTime?

    If user input dates have no times then

    SELECT <Table Fields> 
    
    FROM <Table>
    WHERE <Sample Date> >= <User Input Data1>
    AND <Sample Date> < DATEADD(d,1,<User Input...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: DTS and Active X

    In SQL7 DTS, if you use a test file with the maximum number of columns and define the properties of the file, then when you use real data file, sql...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: How to merge two tables (update/insert)?

    I do this sort of thing frequently and use SP to do it. First I update first table by inner join second table on key. Then I left outer join...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: DERIVEDTBL

    It is an alias and is mandatory when using subqueries (derived tables). As CP is an alias for CustomerPwd in your example. So your query could have looked something like...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: How to replace error message with custom message?

    One way is to use temp table

    SET NOCOUNT ON 
    

    CREATE TABLE #temp (
    Owner varchar (36),
    Object varchar (62),
    Grantee varchar (18),
    Grantor varchar (36),...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Connecting SQL Server 2000 and Visual Basic 6.0

    quote:


    Eagles fly. Turkeys skydive.


    Yeh. It's hard to fly like an Eagle when you work...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: distinct

    Duplicate data can be caused by more than 1 matching row in multiple tables or by insufficient matching of tables. You need to check what is duplicated and do as...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: problem using sp_executesql

    SET @sSQL = N'SELECT @Serial = Serial FROM ' + 
    
    @DBName +
    '.[dbo].[Transaction_Mapping] WHERE TransType = @sTransType'

    execute sp_executesql
    @sSQL,
    N'@sTransType varchar(10), @Serial varchar(10) output',
    @sTransType,...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: stored procedure prob

    select * 
    
    from P_Trade
    where charindex(','+cast(TypeId as varchar)+',',','+@Typeid+',') > 0

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 2,941 through 2,955 (of 3,544 total)