Forum Replies Created

Viewing 15 posts - 106 through 120 (of 166 total)

  • RE: case in where clause

    Hi Sean,

    Thanks for your time on this and a small correction made on the sample data

    create table #Address

    (

    idAddress int,

    idCompany int,

    IdClient int,

    MyAddress varchar(20)

    )

    insert #Address

    select 1 as idAddress, 100 as idCompany, 1000...

  • RE: case in where clause

    Here is the table structure with sample data,

    Table : Address

    select 1 as idAddress, 100 as idCompany, 1000 as IdClient, 'Address1'

    union all...

  • RE: Get Previous month data based on condition

    Hi Jeff,

    Thanks for the response and sure i will pass it forward.Please keep continue your helping hand because "your known is ocean for us" and we will keep learning.

    I will...

  • RE: Get Previous month data based on condition

    Hi Geff,

    First of all i don't have enough vocabulary to thank you because the way you answering to the forum questions are much professional and elaborated which will help every...

  • RE: Get Previous month data based on condition

    Thank you gentle Man!! I will wait.

  • RE: Get Previous month data based on condition

    you meant to say startdate is any date in july 2013 and enddate is any date in jusly 2014. Obviously the data has to fetched because all the 30 dates...

  • RE: Get Previous month data based on condition

    Hi Jeff,

    Thanks for your precious time on this post and here is my exact business requirement,

    From the sample i have provided, assume current date is January 5th which falls...

  • RE: Get Previous month data based on condition

    Hi Jeff,

    Thanks for asking this and i understand the concept. going forward i can help someone what i learned.

  • RE: Get Previous month data based on condition

    Also i verified with my production data and it works perfectly.

    Thanks a lot Michael. Appreciate your time on this post.

  • RE: Get Previous month data based on condition

    Hi Michael,

    i understand, i don't need to worry about am in the first half or second half of the month. the select query itself will take care of it. Ia...

  • RE: Get Previous month data based on condition

    Hi Michael,

    Thanks what i did already

    declare @MyData table (Id int not null, StartDate datetime not null, EndDate datetime not null )

    insert into @MyData

    select 101 as Id,'2014-01-14 13:30:00.000' as StartDate,'2014-02-14...

  • RE: Get Previous month data based on condition

    Hi Michael,

    Thanks for your response.

    On your sample you are hardcoding the Currdate

    set @CurrDate = '2014-01-15 23:59:59.997'

    But i wanted to check the getdate() falls b/w 1st to 15th date...

  • RE: Get Previous month data based on condition

    I just corrected my sample data as follows,

    with sample as (

    select 101 as Id,'2014-01-14 13:30:00.000' as StartDate,'2014-02-14 13:30:00.000' as EndDate union all

    select 102 as Id,'2013-12-19 13:30:00.000' as StartDate,'2014-01-12 13:30:00.000' as...

  • RE: using datediff against datapart

    It's Crazy. You are correct. No need of Datepart and datediff. Simple query is enough.

    Thanks for helping out stopping me to think much. Appreciate your time on...

  • RE: using datediff against datapart

    Hi luis,

    Thanks for your response and here is the sample data.

    with All_Offers as (

    select 101 as IdCoupon,'2014-01-14 13:30:00.000' as OfferStartDate,'2014-02-14 13:30:00.000' as OfferEndDate union all

    select 102 as IdCoupon,'2013-12-19 13:30:00.000' as...

Viewing 15 posts - 106 through 120 (of 166 total)