Hello.
I'm having trouble crafting a SELECT that checks if the End Date of the first record of the query is greater than the start date of the second.
The database in question is for notes, and for some reason, some notes have a start date smaller than the previous end date.
To better illustrate, I'll use the terms Attendance, Pending and Time, remembering that a call can contain more than one pending and a pending call may contain more than one time.
Theintentistoidentifywhichtimeswithinaparticularservicearetheenddategreaterthanthestartdateofthenextrecord.
Thisonlywithintheservice,iecannotbecomparedforexampletheenddateofCDTEMPO256261withthestartdateofCDTEMPO256269.Whytheyareofdifferentattendances.
Ineedideasonhowtoidentifythesetimes.ItdoesnotnecessarilyhavetobeSELECT,itcouldbebyprocedurealsowithnoproblems.InthisselectorprocedureIneedtodisplaythesamefieldsastheimageabove,andreturnonlytherecordthathasthestartdatesmallerthantheenddateofthepreviousrecord.
Intheorytheselect/procedureshouldreturnthis:
Thank you in advance!