raghav
04/27/2023, 2:30 PMSELECT
resourceallocation.allocationResource
FROM
resourceallocation as resourceallocation
WHERE
resourceallocation.startDate <= SYSDATE + (750 / 1440)
AND resourceallocation.endDate >= SYSDATE + (750 / 1440)
GROUP BY
resourceallocation.allocationResource
scottvonduhn
04/27/2023, 3:00 PMendDate >= SYSDATE + (750 / 1440)
, what is the intention with that statement? You are already excluding any endDate that not 12.5 or more hours from the current date/time (SYSDATE returns a date/time value, not a Date), regardless of timezone. Is that what you intend? What is the business logic you are trying to achieve?
In other words, SYSDATE + (750 / 1440)
is always going to be 12.5 hours from now, regardless of timezone (timezone doesn’t matter here)scottvonduhn
04/27/2023, 3:05 PM(750 / 1440)
is going to be an integer division, and will evaluate to 0. If you want it to work as expected, try SYSDATE + (12.5 / 24.0)
insteadscottvonduhn
04/27/2023, 3:06 PMraghav
04/27/2023, 3:07 PMscottvonduhn
04/27/2023, 3:12 PMraghav
04/27/2023, 3:14 PMvar today = new Date();
var indiaToday = format.format({
value: today,
type: format.Type.DATETIME,
timezone: format.Timezone.ASIA_CALCUTTA
});
var finalDate = String(indiaToday).split("/")
Then take the date potion from the string and use it in our filters. I was thinking will have to do siilar in SQL as well, I assumedraghav
04/27/2023, 3:15 PMscottvonduhn
04/27/2023, 3:15 PMraghav
04/27/2023, 3:16 PMscottvonduhn
04/27/2023, 3:16 PMscottvonduhn
04/27/2023, 3:16 PMscottvonduhn
04/27/2023, 3:17 PMscottvonduhn
04/27/2023, 3:17 PMraghav
04/27/2023, 3:21 PMscottvonduhn
04/27/2023, 3:24 PMscottvonduhn
04/27/2023, 3:26 PMraghav
04/27/2023, 3:32 PMscottvonduhn
04/27/2023, 3:32 PMscottvonduhn
04/27/2023, 3:33 PMscottvonduhn
04/27/2023, 3:35 PMscottvonduhn
04/27/2023, 3:41 PM2023-04-27 08:40:00.0
scottvonduhn
04/27/2023, 3:41 PMscottvonduhn
04/27/2023, 3:42 PMscottvonduhn
04/27/2023, 3:43 PM2023-04-27 21:10:00.0
scottvonduhn
04/27/2023, 3:43 PMscottvonduhn
04/27/2023, 3:44 PMraghav
04/27/2023, 4:05 PMraghav
04/27/2023, 8:11 PMAllocation end date = 04/26/2023 00:00 IST = 04/25/2023 11:30 PST.
Case 1:
sysdate = 04/27/2023 00:00 PST.
case 2:
sysdate = 04/27/2023 23:30 PST
Allocation end date = 04/27/2023 00:00 IST = 04/26/2023 11:30.
case 3:
sysdate = 04/27/2023 00:00 PST.
Case 4:
sysdate = 04/27/2023 23:30 PST
Allocation end date = 04/28/2023 00:00 IST = 04/27/2023 11:30.
case 5:
sysdate = 04/27/2023 00:00 PST.
Case 6:
sysdate = 04/27/2023 23:30 PST
Expected output,
Case 3,4,5,6 should pass
Filter (allocation end date on or after today)
SQL:
enddate >= sysdate ( only case 5 passes and 3,4,6 fails)
enddate >= sysdate-1 (only case 3,5,6 passes and 4 fails)
After thinking it out, what you suggested this is what I am thinking.
Can you clarify. Still need to test it out.scottvonduhn
04/27/2023, 9:00 PMraghav
04/27/2023, 9:06 PMscottvonduhn
04/27/2023, 9:08 PMscottvonduhn
04/27/2023, 9:09 PMscottvonduhn
04/27/2023, 9:09 PMscottvonduhn
04/27/2023, 9:13 PMPablo Schneiter
04/28/2023, 8:05 AMPablo Schneiter
04/28/2023, 8:07 AMraghav
04/28/2023, 8:14 AMPablo Schneiter
04/28/2023, 8:42 AMraghav
05/03/2023, 7:33 AM