SOLVED
Holiday Issue Filtering
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Madzy
7 - Meteor
‎05-23-2023
09:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I currently have this issue with Holiday dates. I deal with Bank data and a bank for some reason doesn't give its data out the day before a holiday and the day of. (Example this past weekend was long weekend, it didn't give data for Friday and Monday) And I want it to give me data with the following criteria: If today is Tuesday and yesterday was a holiday then give me Fridays data & If today was Monday and Friday was a holiday then give me Thursday data.
This is a rough draft of what I have but I have been playing around and can't seem to get it working. Currently right now I need data from Friday and Yesterday.
If (DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 1) and [Day_status_Code] = "H" then
IF Day_Caption = "Friday" then
(DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 3) One file (Friday)
(DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 4) second file (Thursday)
elseif Day_Caption= "Monday" then
(DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 1) One file (Monday)
(DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 3) second file (Friday)
endif
ELSEIF (DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 1) and [Day_status_Code] = "W" THEN
IF Datetimeformat(DateTimeToday(),"%a")="Mon" THEN
(DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 3) For Friday
ELSE DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days")=1 The previous day
ENDIF
endif
IF Day_Caption = "Friday" then
(DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 3) One file (Friday)
(DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 4) second file (Thursday)
elseif Day_Caption= "Monday" then
(DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 1) One file (Monday)
(DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 3) second file (Friday)
endif
ELSEIF (DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 1) and [Day_status_Code] = "W" THEN
IF Datetimeformat(DateTimeToday(),"%a")="Mon" THEN
(DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days") = 3) For Friday
ELSE DateTimeDiff(DateTimeToday(),Datetimetrim([As of Date],"days"),"days")=1 The previous day
ENDIF
endif
Any Suggestions or questions is appreciated.
Solved! Go to Solution.
1 REPLY 1
Clifford_Coon
11 - Bolide
‎05-23-2023
10:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Madzy ,
Here is one way:
Generate a listing of dates, filter out Weekends and Holidays.
Then process for current date and previous date (no counting involved)
 
As always, there is a multitude of ways to approach any issue.
Happy Solving.
