I'm trying to create a selection date formula for a specific department that operates from 11:00PM to 7:00AM. i currently have this selection formula:
select case {?Relative Date}
case "None"
if DTSToDate ({table.date}) in {?StartDate} to {EndDate} Then
formula = 1
else
formula = 0
end if
case "Yesterday"
if DTSToDate ({table.date}) = CurrentDate - 1 Then
formula = 1
else
formula = 0
end if
case "Week to Date"
if DTSToDate ({table.date}) = minimum (weektodatefromsun) to maximum (WeekToDateFromSun)-1 Then
formula = 1
else
formula = 0
end if
case "Last Week"
if DTSToDate ({table.date}) = minimum (lastfullweek) to maximum (lastfullweek) Then
formula = 1
else
formula = 0
end if
case "Month to Date"
if DTSToDate ({table.date}) = minimum (monthtodate) to maximum (monthtodate)-1 Then
formula = 1
else
formula = 0
end if
case "Last Month"
if DTSToDate ({table.date}) = minimum (lastfullmonth) to maximum (lastfullmonth) Then
formula = 1
else
formula = 0
end if
case "Year to Date"
if DTSToDate ({table.date}) = minimum (yeartodate) to maximum (yeartodate)-1 Then
formula = 1
else
formula = 0
end if
case else
formula = 0
end select
How can I define a day or rewrite this formula so that when I select Yesterday, Last Week, etc crystal knows that a day is equal to 11:00PM to 7:00AM?
select case {?Relative Date}
case "None"
if DTSToDate ({table.date}) in {?StartDate} to {EndDate} Then
formula = 1
else
formula = 0
end if
case "Yesterday"
if DTSToDate ({table.date}) = CurrentDate - 1 Then
formula = 1
else
formula = 0
end if
case "Week to Date"
if DTSToDate ({table.date}) = minimum (weektodatefromsun) to maximum (WeekToDateFromSun)-1 Then
formula = 1
else
formula = 0
end if
case "Last Week"
if DTSToDate ({table.date}) = minimum (lastfullweek) to maximum (lastfullweek) Then
formula = 1
else
formula = 0
end if
case "Month to Date"
if DTSToDate ({table.date}) = minimum (monthtodate) to maximum (monthtodate)-1 Then
formula = 1
else
formula = 0
end if
case "Last Month"
if DTSToDate ({table.date}) = minimum (lastfullmonth) to maximum (lastfullmonth) Then
formula = 1
else
formula = 0
end if
case "Year to Date"
if DTSToDate ({table.date}) = minimum (yeartodate) to maximum (yeartodate)-1 Then
formula = 1
else
formula = 0
end if
case else
formula = 0
end select
How can I define a day or rewrite this formula so that when I select Yesterday, Last Week, etc crystal knows that a day is equal to 11:00PM to 7:00AM?