please help me date ranges update based on first service used

  • telephonic Service given like
    Employee_code          Start_date    End_date
    E1                               1-1-2018       31-12-2018

    once he used the first call service on 1-5-2018 then data should be end date+365 days

    Employee_code          Start_date    End_date
    E1                               1-1-2018       30-04-2019

    once he reached current date as 30-04-2019 then system should populate another entry like 
    Employee_code          Start_date    End_date
    E1                               1-5-2019       30-04-2020

    again have to check  first call service when he used on this period, and add 365 days to the end_date.

  • vemula.narayanan - Monday, June 11, 2018 9:06 PM

    telephonic Service given like
    Employee_code          Start_date    End_date
    E1                               1-1-2018       31-12-2018

    once he used the first call service on 1-5-2018 then data should be end date+365 days

    Employee_code          Start_date    End_date
    E1                               1-1-2018       30-04-2019

    once he reached current date as 30-04-2019 then system should populate another entry like 
    Employee_code          Start_date    End_date
    E1                               1-5-2019       30-04-2020

    again have to check  first call service when he used on this period, and add 365 days to the end_date.

    I'm not at all clear on what you are looking for.   There's a good chance there's a language barrier, because the words you used don't match the data you supplied, and the meaning of "once he used the first call service" is not very meaningful, as there's no context to give it meaning.   I can guess that you are referring to some kind of telephone service, and there is some "event" that occurs that requires you to add a year to the end date, but then your data shows you only having added 4 months...  Then for your second "event", it would appear to be the mere passage of time, however, surely there must be a payment from the customer for the service before you renew it, so there's likely a need for there to be a renewal business process that occurs, and not merely the passage of time.

    Now you need to explain in more detail why the data doesn't agree with your desired objective, and provide some context as to just what this data is going to actually represent, so that we can provide better advice.   Also, have you tried anything yet?   If you have existing tables, how about providing table create statements and some sample data as insert statements, along with what the expected results would be, given the sample data.   Then indicate what you've tried so far....

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • As Steve mentioned, the question isn't well phrased for us.

    You can use DateAdd to add days to a date.

    What I'd suggest is you mock up 5-10 rows and then work out the row you want to query for and what criteria you use. Then show what the new row should look like. This will help us, but also it's important for you to understand the scope of your requirement. When you give a single row, you're usually not thinking through the requirement that you need to meet.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply