I couldn't get the full refnum to copy over or the time field but they are there and the math is correct...it just seems to be doing a calculation from a point in time for each record. I could do the If {@January}>0 then {@January} else 0 and that would get rid of the negative values but I wasn't sure if that was the way to go..to go from seconds I added /60/60/24 on to the end of the formula (that I did for each month)
RefnApr. May. June.July.Aug. Sept. Oct. Nov. Dec. JAN. Feb. March
13, 29. 8. -22 -52. -83 -114 -144. -175. -205. -236. -267. -295 2/10/2005 5/9/2005
13, 6. -23 -54 -84. -11 -146 -176. -207. -237. -268. -299. -327 2/21/2005 4/7/2005
13, 26. -3. -34 -64. -95 -126 -156. -187. -217. -248. -279. -307 2/25/2005 4/27/2005
13, 17. -12 -43 -73. -10 -135 -165. -196. -226. -257. -288. -316 2/27/2005 4/18/2005
13, 10. -19 -50 -80. -11 -142 -172. -203. -233. -264. -295. -323 3/4/2005 4/11/2005
13, 0. -29 -60 -90. -12 -152 -182. -213. -243. -274. -305. -333 3/7/2005 4/1/2005
13, 14. -15 -46 -76. -10 -138 -168. -199. -229. -260. -291. -319 3/10/2005 4/15/2005
13, 0. -29 -60 -90. -12 -152 -182. -213. -243. -274. -305. -333 3/11/2005 4/1/2005
13, 29. 12. -18 -48. -79 -110 -140. -171. -201. -232. -263. -291 3/14/2005 5/13/2005
13, 20. -9. -40 -70. -10 -132 -162. -193. -223. -254. -285. -313 3/16/2005 4/21/2005
13, 5. -24 -55 -85. -11 -147 -177. -208. -238. -269. -300. -328 3/16/2005 4/6/2005
13, 29. 15. -15 -45. -76 -107 -137. -168. -198. -229. -260. -288 3/18/2005 5/16/2005
13, 0. -29 -60 -90. -12 -152 -182. -213. -243. -274. -305. -333 3/21/2005 4/1/2005
13, 29. 16. -14 -44. -75 -106 -136. -167. -197. -228. -259. -287 3/22/2005 5/17/2005
13, 17. -12 -43 -73. -10 -135 -165. -196. -226. -257. -288. -316 3/24/2005 4/18/2005
13, 1. -28 -59 -89. -12 -151 -181. -212. -242. -273. -304. -332 3/25/2005 4/2/2005
13, 1. -28 -59 -89. -12 -151 -181. -212. -242. -273. -304. -332 3/25/2005 4/2/2005
13, 26. -3. -34 -64. -95 -126 -156. -187. -217. -248. -279. -307 3/28/2005 4/27/2005
13, 4. -25 -56 -86. -11 -148 -178. -209. -239. -270. -301. -329 3/30/2005 4/5/2005
13, 1. -28 -59 -89. -12 -151 -181. -212. -242. -273. -304. -332 3/31/2005 4/2/2005
13, 0. -29 -60 -90. -12 -152 -182. -213. -243. -274. -305. -333 3/31/2005 4/1/2005
13, 7. -22 -53 -83. -11 -145 -175. -206. -236. -267. -298. -326 3/31/2005 4/8/2005
13, 5. -25 -56 -86. -11 -148 -178. -209. -239. -270. -301. -329 3/31/2005 4/5/2005
13, 4. -25 -56 -86. -11 -148 -178. -209. -239. -270. -301. -329 3/31/2005 4/5/2005
13, 29. 5. -25 -55. -86 -117 -147. -178. -208. -239. -270. -298 3/31/2005 5/6/2005
13, 2. -27 -58 -88. -11 -150 -180. -211. -241. -272. -303. -331 4/1/2005 4/3/2005
13, 2. -26 -57 -87. -11 -149 -179. -210. -240. -271. -302. -330 4/1/2005 4/4/2005
13, 2. -26 -57 -87. -11 -149 -179. -210. -240. -271. -302. -330 4/1/2005 4/4/2005
13, 16. -12 -43 -73. -10 -135 -165. -196. -226. -257. -288. -316 4/2/2005 4/18/2005
13, 1. -26 -57 -87. -11 -149 -179. -210. -240. -271. -302. -330 4/2/2005 4/4/2005
13, 2. -25 -56 -86. -11 -148 -178. -209. -239. -270. -301. -329 4/2/2005 4/5/2005
13, 6. -21 -52 -82. -11 -144 -174. -205. -235. -266. -297. -325 4/2/2005 4/9/2005
13, 1. -27 -58 -88. -11 -150 -180. -211. -241. -272. -303. -331 4/2/2005 4/3/2005
13, 7. -19 -50 -80. -11 -142 -172. -203. -233. -264. -295. -323 4/4/2005 4/11/2005
13, 1. -24 -55 -85. -11 -147 -177. -208. -238. -269. -300. -328 4/4/2005 4/6/2005
13, 0. -25 -56 -86. -11 -148 -178. -209. -239. -270. -301. -329 4/4/2005 4/5/2005
13, 0. -25 -56 -86. -11 -148 -178. -209. -239. -270. -301. -329 4/4/2005 4/5/2005
13, 2. -24 -55 -85. -11 -147 -177. -208. -238. -269. -300. -328 4/4/2005 4/6/2005
13, 2. -23 -54 -84. -11 -146 -176. -207. -237. -268. -299. -327 4/4/2005 4/7/2005
13, 0. -24 -55 -85. -11 -147 -177. -208. -238. -269. -300. -328 4/5/2005 4/6/2005
13, 0. -24 -55 -85. -11 -147 -177. -208. -238. -269. -300. -328 4/5/2005 4/6/2005
13, 9. -16 -47 -77. -10 -139 -169. -200. -230. -261. -292. -320 4/5/2005 4/14/2005
13, 1. -23 -54 -84. -11 -146 -176. -207. -237. -268. -299. -327 4/5/2005 4/7/2005
13, 0. -24 -55 -85. -11 -147 -177. -208. -238. -269. -300. -328 4/5/2005 4/6/2005
13, 0. -23 -54 -84. -11 -146 -176. -207. -237. -268. -299. -327 4/6/2005 4/7/2005
13, 15. -8. -39 -69. -10 -131 -161. -192. -222. -253. -284. -312 4/6/2005 4/22/2005
13, 8. -15 -46 -76. -10 -138 -168. -199. -229. -260. -291. -319 4/6/2005 4/15/2005
13, 0. -23 -54 -84. -11 -146 -176. -207. -237. -268. -299. -327 4/6/2005 4/7/2005
13, 1. -22 -53 -83. -11 -145 -175. -206. -236. -267. -298. -326 4/6/2005 4/8/2005
13, 1. -21 -52 -82. -11 -144 -174. -205. -235. -266. -297. -325 4/7/2005 4/9/2005
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},4,1),dateserial({?fiscalyear},4+1,1)-1) else
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},4,1),{@ICU dis date time}) else
if {@ICU admit date time} >= dateserial({?fiscalyear}, 4,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) else
if {@ICU admit date time} >= dateserial({?fiscalyear},4,1) and
{@ICU dis date time} <= dateserial({?fiscalyear},4+1,1)-1 then
datediff(("s"),{@ICU admit date time},{@ICU dis date time}))/60/60/24
I made April through to December {?fiscalyear}
and Jan through March 31 ({?fiscalyear}+1
Above is April code
Below is a March code
Code:
if {@ICU admit date time} < dateserial({?fiscalyear}+1, 3,1) and
{@ICU dis date time} > dateserial({?fiscalyear}+1,3+1,1)-1 then
datediff(("s"), date({?fiscalyear}+1,3,1),dateserial({?fiscalyear}+1,3+1,1)-1) else
if {@ICU admit date time} < dateserial({?fiscalyear}+1, 3,1) and
{@ICU dis date time} <= dateserial({?fiscalyear}+1,3+1,1)-1 then
datediff(("s"), date({?fiscalyear}+1,3,1),{@ICU dis date time}) else
if {@ICU admit date time} >= dateserial({?fiscalyear}+1, 3,1) and
{@ICU dis date time} > dateserial({?fiscalyear}+1,3+1,1)-1 then
datediff(("s"),{@ICU admit date time},dateserial({?fiscalyear}+1,3+1,1)-1) else
if {@ICU admit date time} >= dateserial({?fiscalyear}+1,3,1) and
{@ICU dis date time} <= dateserial({?fiscalyear}+1,3+1,1)-1 then
datediff(("s"),{@ICU admit date time},{@ICU dis date time})
In the Record Selector formula I have the following
Code:
{@ICU admit date time} < dateserial({?fiscalyear}+1,4,1) and
{@ICU dis date time} >= dateserial({?fiscalyear},4,1)
Hope this helps you help me, I really do appreciate your help