Forum Replies Created

Viewing 15 posts - 16 through 30 (of 58 total)

  • Reply To: When value is same for the status then

    suggestion please

  • Reply To: max date order by status

    suggestion please

  • Reply To: max date order by status

    ShambhuRai-4099  JingyangLi · 3 minutes ago

    when value is same for the status then it should take min date

    expected output

    ('2022-01-04 18:00:57','Newone','segmentone')

    when the value is change for the status then max date

    expected output

    ('2022-04-04 19:00:57','Newtwo','segmentfour')

  • Reply To: max date order by status

    Hi Expert,

    Hi Expert,

    there is condition when value is same for the status then it should take min date and if the value is change for the status then max date

    create...

    • This reply was modified 2 years, 7 months ago by  Shree23.
    • This reply was modified 2 years, 7 months ago by  Shree23.
    • This reply was modified 2 years, 7 months ago by  Shree23.
  • Reply To: max date order by status

    HI Expert,

     

    This is perfect. but the data needs max(date) should be order by same day and not all calendar days

     

    insert into test

     

    values

    ('2022-01-04 18:00:57','Newone','segmentone'),('2022-01-04 19:00:57','Newone','segmenwo'),

    ('2022-04-04 18:00:57','Newtwo','segmenthee'),('2022-04-04 19:00:57','Newtwo','segmenfour')

     

    expected output:

    ('2022-01-04 19:00:57','Newone','segmenwo'),

    ('2022-04-04 19:00:57','Newtwo','segmenfour')

     

     

  • Reply To: first letter capital of the word

    what a solution ..is there any easiest way to do this just want to have capital word after space

  • Reply To: running sum based on date

    it shows multiple dates for values which is incorrect

     

    Screenshot 2022-02-28 204416

  • Reply To: startdate -1

    Hi Expert,

     

    it is showing incorrect output. Am attaching the expected output again

    Screenshot 2022-03-15 185449

  • Reply To: startdate -1

     

    Hi Expert,

    I am so sorry

    here is the expected output

     

    Screenshot 2022-03-15 185449

  • Reply To: startdate -1

    i tried

    SELECT TestID, Status, StartDate, case when Lead(StartDate) OVER (PARTITION BY TestID ORDER BY StartDate) =LEAD(StartDate) OVER (PARTITION BY TestID ORDER BY StartDate) then Lag(StartDate) OVER (PARTITION BY TestID ORDER...

  • Reply To: startdate -1

    I have repeated and loaded  the insert statement

     

    insert into table3

    values

    ('1','Progress', '20210203'),

    ('1', 'Closed', '20220403'),

    ('2', 'Closed', '20220703'),

    ('2', 'Progress', '20220503')

     

    it is showing wrong output

    Screenshot 2022-03-15 185449

    if the date is repeated...

  • Reply To: startdate -1

    select Testid, Status ,count(testid) as count,

    Startdate, lead(DATEADD(day,-1,Startdate)) over (order by testid,Startdate) from table3 group by Testid,Status,Startdate

     

    I tried above lead function but unable to get above output

  • Reply To: units divided by quantity and order by date

    suggestion pls

  • Reply To: units divided by quantity and order by date

    Hi,

    Actually id do not understand logic for this help me with clue

    on the 6th April -Main Table - 1 (quantity )sold and 73 consumables from Ratio Table on 7th April-...

  • Reply To: LAST MAX 2 DATES

     

    when i have added 2 rows and max 2 rows is giving '2021-02-19' only one record

    ('577', '-1', '0', '2021-02-19');

    ('577', '-1', '1', '2021-02-20');

Viewing 15 posts - 16 through 30 (of 58 total)