Forum Replies Created

Viewing 15 posts - 76 through 90 (of 166 total)

  • RE: using join in PIVOT

    Hi Sean/ Luis,

    Any help please.

  • RE: using join in PIVOT

    Here is my next level of try

    select name,case when DataReceived IS not null then RecordsCount

    else (select top 1 DATEADD(DAY, c.DaysInLate, md.MyDate) from #data d2 join #company c on d2.Name...

  • RE: using join in PIVOT

    Thank you Luis and Sean.

    Here is my try

    use tempdb;

    set nocount on;

    if OBJECT_ID('dbo.TallyTable') is not null drop table dbo.TallyTable

    go

    select top 100 IDENTITY(int,1,1) as ID

    into dbo.TallyTable from master.dbo.syscolumns

    alter table dbo.TallyTable add...

  • RE: using join in PIVOT

    if am not wrong that i need to create tally table?

  • RE: using join in PIVOT

    Hi Sean,

    Thank you and if i execute the script i ma getting error as below. would like to anything wrong from my side

    (3 row(s) affected)

    (11 row(s) affected)

    Msg 208, Level 16,...

  • RE: using join in PIVOT

    yes, all my output data can be text. any help please

  • RE: using join in PIVOT

    Please run this script to know the my desired output,

    select 1000 as '2013-08-01', 1001 as '2013-08-02', 1002 as '2013-08-03', 1003 as '2013-08-04',1005 as '2013-08-05',1005 as '2013-08-06',

    1006 as '2013-08-07',1007 as '2013-08-08',1004...

  • RE: using join in PIVOT

    Hi Sean,

    Thanks for your time on this. please execute the below query and please take a look at column(2013-08-12) the value is null.

    I need to join the table data with...

  • RE: using join in PIVOT

    Hi Sean,

    Thanks for your reply.

    If the value is null then get the column form the pivot which is date and get the "daysinlate" data from table compaany based on the...

  • RE: last 6 months data

    Hi Luis,

    I understood the query well as you have explained very clearly. Even i added new condition to take care of null as well. I am all set now. thanks...

  • RE: last 6 months data

    Great. Last but not least, If i need to ignore 0 as well when taking average should i have to add one more case condition?

    when MIN(PutchaseAmount) = 0 then AVG(NULLIF(PutchaseAmount...

  • RE: last 6 months data

    Hi Luis,

    Thanks a lot for your precious time on this post.

    I prefer the second one because i should not consider the -1 when taking average. Where should i change the...

  • RE: last 6 months data

    Hi Luis,

    Thanks for your hints. I am thinking about how to make aggregate function not to consider the value -1. So i tried with casting as float. am i doing...

  • RE: Remote Stored Procedure call

    Hi lowel,

    Even i am interested in going with linked server. But as my client needs other way i posted for suggestions. Thanks for your wonderful reply and i will start...

  • RE: Remote Stored Procedure call

    Hi Sean,

    thanks for your reply. this is my client requirement. wondering is there any way to achieve without creating linked server.please suggest me

Viewing 15 posts - 76 through 90 (of 166 total)