Forum Replies Created

Viewing 15 posts - 136 through 150 (of 245 total)

  • RE: Find date difference

    declare @visits table(username varchar(50),visit_date datetime)

    --sample data

    insert into @visits

    select

    'aaa' ,'6/1/2011'

    union

    select

    'aaa' ,'6/5/2011'

    union

    select

    'bbb' ,'6/10/2011'

    union

    select

    'ccc' ,'6/11/2011'

    union

    select

    'ddd', '6/5/2011'

    union

    select

    'ddd' ,'6/20/2011'

    union

    select

    'ddd','6/25/2011'

    ;

    with my_cte(username,visit_date,myRowNumber) as (

    select *

    ,ROW_NUMBER() OVER(PARTITION BY username order by visit_date) as myRowNum

    from

    @visits v1

    )

    select...

  • RE: Best way to alias column names

    dont thin it makes a difference. one thing i have noticed is if i create an alias like this:

    select

    'alias' = firstname + ' ' Surname

    from

    people

    i can't reference that alias in...

  • RE: Mathematical Theory (controversy!)

    mister.magoo (6/3/2011)


    Finally, consider the following axiom:

    Q: How many mathematicians does it take to screw in a lightbulb?

    A: 0.999999....

    A: Show me how they got into the light bulb!

    great answer!!

  • RE: How to use the try catch block in Function?

    is there a purpose for putting a TRY CATCH into a function that is merely a simple SELECT statement?

    What error would be expected?

  • RE: Subsequent rows compare

    maybe start with something like this

    declare @table table(ID int,Amount int,myDate smalldatetime,flag char(1))

    insert into @table

    select 22,12300,'2009-03-12',''

    union

    select 23,2123,'2009-04-16',''

    union

    select 12,1232,'2009-04-20',''

    union

    select 43,23434,'2009-06-22',''

    union

    select 44,23423,'2009-07-23',''

    ;

    with my_Cte(rownum,id,amount,mydate,flag)

    as(

    select

    ROW_NUMBER() over (order by mydate),

    * from @table d

    )

    select

    c1.rownum as...

  • RE: Invalid Column Name error

    maybe the columns have only just been added, so the intellisense can't see it?

    i press ctrl+shift+r to refresh.

  • RE: Javacript interface with SQL

    would hidden fields on your web page help? store the values in the hidden field using javascript, and then access them in c#.

  • RE: Export and print issue

    when i had this problem it was due to the Body width being greater than the page width minus the left & right margins.

    here's a link

    http://blogs.msdn.com/b/chrisbal/archive/2006/08/10/694892.aspx

  • RE: Borders of Textbox in Tablix control overlap each other

    thanks for the reply.

    I tried your advice out, to replace the cells with no border for the same expression and it worked but i didn't really feel it looked nice.

    It...

  • RE: clicking 'Active THreads' link gives differnet results between Google Chrome and IE

    Chrome is now showing 4 topics while IE is still showing 150.

  • RE: SQL Server Query

    declare @table table(id int ,name varchar(50))

    insert into @table

    select 1,'ron'

    union

    select 2,'tango'

    union

    select 3,'danny'

    union

    select 4,'amo'

    declare @param varchar(50) = 'tango'

    select id,name from

    (

    select

    * ,

    case when name = @param then 1 else 0 end...

  • RE: Pivot Query help

    I think I got this way of doing it from SQLServerCEntral.

    Unfortunately i cant remember the name of the person to give them a name-check.

    declare @pivot_columns table(pivot_column varchar(100))

    insert into @pivot_columns

    select ID...

  • RE: DATEDIFF ON MAX DATE

    think you need an extra closing bracket before Days_with_Voids. currently you just have one.

    )) as Days_with_Voids

  • RE: Wrong "row_number" behaviour

    i would think the over(partition by choice order by choice_seqn ) is going to ORDER BY Choice_sqn within each Choice that you have partitioned by. Since each Choice only...

  • RE: SUB QUERY RETURNED MORE THAN ONE VALUE

    SELECT TOP 100 ADDRESSLINE1 FROM MST_ADDRESS WHERE ADDRESSLINE1 in

    (SELECT colName FROM DIGITLOOKUPS.dbo.INPROGRESS_POBOX_EXCLUSION_LOOKUP where colName like ''+KEY_WORD+'%')

    maybe?

Viewing 15 posts - 136 through 150 (of 245 total)