Hi LB,
Well I thing something is a miss, but not sure what
Here is the Record selection formula
Code:
{@ICU admit date time} < dateserial({?fiscalyear}+1,4,1) and
{@ICU dis date time} >= dateserial({?fiscalyear},4,1)
Here is April (start of fiscal) formula
Code:
(if {@ICU admit date time} < dateserial({?fiscalyear}, 4,1) and
{@ICU dis date time} > dateserial({?fiscalyear},4+1,1)-1 then
datediff(("s"), date({?fiscalyear}+1,4,1),dateserial({?fiscalyear},4+1,1)-1)+1 else
if {@ICU admit date time} < dateserial({?fiscalyear}, 4,1) and
{@ICU dis date time} <= dateserial({?fiscalyear},4+1,1)-1 and
{@ICU dis date time} >= dateserial({?fiscalyear},4,1) then
datediff(("s"), date({?fiscalyear}+1,4,1),{@ICU dis date time})+1 else
if {@ICU admit date time} >= dateserial({?fiscalyear}, 4,1) and
{@ICU admit date time} < dateserial({?fiscalyear},4+1,1)-1 and
{@ICU dis date time} > dateserial({?fiscalyear},4+1,1)-1 then
datediff(("s"),{@ICU admit date time},dateserial({?fiscalyear},4+1,1)-1)+1 else
if {@ICU admit date time} >= dateserial({?fiscalyear}+1,4,1) and
{@ICU dis date time} <= dateserial({?fiscalyear},4+1,1)-1 then
datediff(("s"),{@ICU admit date time},{@ICU dis date time})+1)/60/60/24
Here is a January formula(same fiscal but new year)
Code:
(if {@ICU admit date time} < dateserial({?fiscalyear}+1, 1,1) and
{@ICU dis date time} > dateserial({?fiscalyear}+1,1+1,1)-1 then
datediff(("s"), date({?fiscalyear}+1,1,1),dateserial({?fiscalyear}+1,1+1,1)-1)+1 else
if {@ICU admit date time} < dateserial({?fiscalyear}+1, 1,1) and
{@ICU dis date time} <= dateserial({?fiscalyear}+1,1+1,1)-1 and
{@ICU dis date time} >= dateserial({?fiscalyear}+1,1,1) then
datediff(("s"), date({?fiscalyear}+1,1,1),{@ICU dis date time})+1 else
if {@ICU admit date time} >= dateserial({?fiscalyear}+1, 1,1) and
{@ICU admit date time} < dateserial({?fiscalyear}+1,1+1,1)-1 and
{@ICU dis date time} > dateserial({?fiscalyear}+1,1+1,1)-1 then
datediff(("s"),{@ICU admit date time},dateserial({?fiscalyear}+1,1+1,1)-1)+1 else
if {@ICU admit date time} >= dateserial({?fiscalyear}+1,1,1) and
{@ICU dis date time} <= dateserial({?fiscalyear}+1,1+1,1)-1 then
datediff(("s"),{@ICU admit date time},{@ICU dis date time})+1)/60/60/24
Think I did it correctly, copied and pasted from your last post except remove the {?fiscalyear}+1, and replaced it with just {?fiscalyear} for months April through December (which is the way I had it before)
Now I get primarily zeros everywhere and some negative values
Here is a sample of the returning data
Apr. May. June. July. Aug. Sept. Oct. Nov. Dec. JAN. Feb. March
Refnum
11,875 -336.00 30.00 29.00 4.55 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1/20/2004 1:44:00PM 7/5/2004 1:10:00PM
12,014 -337.51 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 2/23/2004 8:05:00PM 4/28/2004 11:45:00AM
12,044 -358.29 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 2/29/2004 6:30:00PM 4/7/2004 5:00:00PM
12,051 -360.23 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/1/2004 7:40:00PM 4/5/2004 6:30:00PM
12,084 -336.00 27.65 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/9/2004 3:50:00PM 5/28/2004 3:30:00PM
12,100 -336.00 25.63 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/12/2004 7:45:00PM 5/26/2004 3:00:00PM
12,117 -353.12 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/17/2004 6:30:00PM 4/12/2004 9:00:00PM
12,118 -336.00 4.17 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/17/2004 10:00:00PM 5/5/2004 4:00:00AM
12,122 -363.26 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/18/2004 12:30:00AM 4/2/2004 5:40:00PM
12,133 -345.35 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/20/2004 7:20:00AM 4/20/2004 3:30:00PM
12,138 -348.23 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/20/2004 9:00:00PM 4/17/2004 6:30:00PM
12,144 -363.46 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/23/2004 1:00:00PM 4/2/2004 1:00:00PM
12,152 -357.35 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/25/2004 1:35:00AM 4/8/2004 3:43:00PM
12,167 -364.37 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/28/2004 10:15:00PM 4/1/2004 3:00:00PM
12,169 -363.16 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/28/2004 11:10:00PM 4/2/2004 8:10:00PM
12,170 -359.49 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/29/2004 2:00:00AM 4/6/2004 12:15:00PM
12,177 -363.42 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/30/2004 1:00:00PM 4/2/2004 1:55:00PM
12,180 -360.28 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/31/2004 1:50:00PM 4/5/2004 5:15:00PM
12,181 -364.33 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/31/2004 4:10:00PM 4/1/2004 4:00:00PM
12,182 -364.35 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/31/2004 5:45:00PM 4/1/2004 3:30:00PM
12,183 -362.36 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3/31/2004 6:10:00PM 4/3/2004 3:20:00PM
12,184 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/1/2004 1:04:00PM 4/4/2004 2:48:00PM
12,185 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/1/2004 6:00:00PM 4/3/2004 2:35:00PM
12,186 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/1/2004 6:15:00PM 4/6/2004 3:20:00PM
12,188 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/2/2004 12:37:00PM 4/3/2004 3:05:00PM
12,189 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/2/2004 2:15:00PM 4/5/2004 3:00:00PM
12,192 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/2/2004 4:20:00PM 4/16/2004 5:30:00PM
12,190 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/2/2004 6:20:00PM 4/4/2004 4:10:00PM
12,193 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/2/2004 6:30:00PM 4/6/2004 2:30:00PM
12,191 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/2/2004 7:55:00PM 4/4/2004 5:30:00PM
12,194 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/3/2004 7:15:00PM 4/5/2004 11:30:00AM
12,195 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/4/2004 5:25:00AM 4/4/2004 10:39:00AM
12,196 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/4/2004 6:15:00AM 4/4/2004 5:30:00PM
12,197 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/4/2004 6:30:00AM 4/16/2004 3:00:00PM
12,198 25.52 18.59 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/4/2004 11:30:00AM 5/19/2004 2:05:00PM
12,200 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/4/2004 2:15:00PM 4/6/2004 4:00:00PM
12,201 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/4/2004 6:05:00PM 4/7/2004 11:55:00AM
12,202 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/5/2004 12:07:00PM 4/6/2004 1:30:00PM
12,203 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/5/2004 1:21:00PM 4/8/2004 11:00:00AM
12,205 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/5/2004 2:15:00PM 4/8/2004 6:55:00PM
12,206 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/5/2004 4:15:00PM 4/16/2004 11:37:00AM
12,204 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/5/2004 6:40:00PM 4/10/2004 1:37:00PM
12,207 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/6/2004 12:16:00PM 4/8/2004 4:35:00PM
12,209 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/6/2004 4:06:00PM 4/7/2004 2:20:00PM
12,208 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/6/2004 5:42:00PM 4/8/2004 12:50:00PM
12,210 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/7/2004 7:28:00AM 4/9/2004 5:15:00PM
12,211 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/7/2004 2:20:00PM 4/9/2004 1:00:00PM
12,212 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/7/2004 6:35:00PM 4/8/2004 10:15:00PM
12,213 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/7/2004 8:00:00PM 4/9/2004 3:30:00PM
12,214 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/8/2004 1:00:00AM 4/8/2004 6:30:00PM
12,215 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/8/2004 11:55:00AM 4/9/2004 12:05:00PM
12,216 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/8/2004 3:45:00PM 4/10/2004 3:00:00PM
12,217 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/8/2004 5:30:00PM 4/9/2004 4:30:00PM
12,218 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/8/2004 6:50:00PM 4/15/2004 2:00:00PM
12,219 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/8/2004 9:10:00PM 4/11/2004 11:30:00AM
12,220 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/9/2004 7:50:00AM 4/10/2004 3:00:00PM
12,221 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/9/2004 9:15:00AM 4/13/2004 11:00:00PM
12,222 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/9/2004 2:23:00PM 4/9/2004 3:28:00PM
12,223 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/9/2004 11:00:00PM 4/10/2004 2:00:00PM
12,224 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/10/2004 1:15:00PM 4/15/2004 3:00:00PM
12,225 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/10/2004 6:40:00PM 4/11/2004 3:05:00PM
12,226 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/11/2004 3:45:00AM 4/12/2004 3:15:00PM
12,228 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/11/2004 11:40:00AM 4/12/2004 4:10:00PM
12,227 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/11/2004 1:45:00PM 4/14/2004 2:00:00PM
12,229 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/11/2004 3:45:00PM 4/16/2004 4:15:00PM
12,230 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/12/2004 1:00:00AM 4/12/2004 7:30:00PM
12,231 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/12/2004 1:15:00PM 4/15/2004 2:30:00PM
12,232 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/12/2004 6:35:00PM 4/14/2004 2:00:00PM
12,234 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/13/2004 12:50:00PM 4/14/2004 4:00:00PM
12,233 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/13/2004 4:30:00PM 4/13/2004 9:40:00PM
12,235 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/13/2004 5:15:00PM 4/15/2004 11:11:00AM
12,236 16.25 17.56 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/13/2004 6:00:00PM 5/18/2004 1:30:00PM
12,237 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/13/2004 6:50:00PM 4/27/2004 5:30:00PM
12,238 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/14/2004 12:40:00AM 4/15/2004 3:00:00PM
12,239 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/14/2004 1:10:00AM 4/22/2004 7:00:00PM
12,241 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/14/2004 1:14:00PM 4/16/2004 1:30:00PM
12,240 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/14/2004 1:40:00PM 4/15/2004 4:30:00PM
12,243 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/14/2004 6:05:00PM 4/16/2004 2:55:00PM
12,242 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/14/2004 6:20:00PM 4/15/2004 3:00:00PM
12,244 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/15/2004 9:15:00AM 4/17/2004 1:35:00PM
12,246 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/15/2004 11:40:00AM 4/16/2004 3:20:00PM
12,245 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/15/2004 1:10:00PM 4/28/2004 1:30:00PM
12,247 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/15/2004 3:50:00PM 4/18/2004 10:45:00AM
12,250 14.29 10.60 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/15/2004 5:03:00PM 5/11/2004 2:20:00PM
12,249 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/15/2004 6:00:00PM 4/17/2004 11:30:00AM
12,248 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/15/2004 7:00:00PM 4/16/2004 2:53:00PM
12,253 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/16/2004 12:07:00PM 4/16/2004 6:00:00PM
12,251 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/16/2004 12:55:00PM 4/19/2004 10:40:00AM
12,252 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/16/2004 1:05:00PM 4/26/2004 2:30:00PM
12,254 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/16/2004 3:00:00PM 4/18/2004 2:30:00PM
12,256 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/16/2004 5:20:00PM 4/19/2004 4:58:00PM
12,255 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/16/2004 5:35:00PM 4/17/2004 2:45:00PM
12,257 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/17/2004 4:10:00AM 4/17/2004 8:30:00PM
12,258 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 4/18/2004 1:00:00AM 4/19/2004 2:30:00PM