So I have a field calculate field on my report. The formula should return a DateTime value based on some values.
Below is the formula
DateTime (DateValue(
if abs(DayOfWeek({vw_prfma_proforma.Dock_Date}) - {vw_prfma_proforma.p_dock_no}) < 4 then
(
if DayOfWeek({vw_prfma_proforma.Dock_Date}) > {vw_prfma_proforma.p_dock_no} then
dateadd("d",-(DayOfWeek({vw_prfma_proforma.Dock_Date})-{vw_prfma_proforma.p_dock_no}),{vw_prfma_proforma.Dock_Date})
else if DayOfWeek({vw_prfma_proforma.Dock_Date}) < {vw_prfma_proforma.p_dock_no} then
dateadd("d",{vw_prfma_proforma.p_dock_no}-DayOfWeek({vw_prfma_proforma.Dock_Date}),{vw_prfma_proforma.Dock_Date})
else
dateadd("d",0,{vw_prfma_proforma.Dock_Date})
)
else
(
if DayOfWeek({vw_prfma_proforma.Dock_Date}) > {vw_prfma_proforma.p_dock_no} then
dateadd("d",7 , dateadd("d",-(DayOfWeek({vw_prfma_proforma.Dock_Date})-{vw_prfma_proforma.p_dock_no}),{vw_prfma_proforma.Dock_Date}))
else if DayOfWeek({vw_prfma_proforma.Dock_Date}) < {vw_prfma_proforma.p_dock_no} then
dateadd("d",-7,dateadd("d",{vw_prfma_proforma.p_dock_no}-DayOfWeek({vw_prfma_proforma.Dock_Date}),{vw_prfma_proforma.Dock_Date}))
else
dateadd("d",0,{vw_prfma_proforma.Dock_Date})
)
)
,Time(
cdbl(
left(
replace(Space( 5-Length (replace(cstr({vw_prfma_proforma.p_dtoleranc}),".00","")))
+ cstr(replace(cstr({vw_prfma_proforma.p_dtoleranc}),".00",""))," ","0")
,3))
,
cdbl(
right(
replace(Space( 5-Length (replace(cstr({vw_prfma_proforma.p_dtoleranc}),".00","")))
+ cstr(replace(cstr({vw_prfma_proforma.p_dtoleranc}),".00",""))," ","0")
,2))
,0
))
The problem I am facing is, it loads in the Preview mode, giving desired data. However, when loaded up in the browser, it gives the following error
Error in formula . 'DateTime (DateValue( ' This field name is not known.
I am at a loss as to what to do. I verified DB on print and it gives me that. Without the verification command, all values come back as zero. Please help.
DateTime
orDateValue
are unavailable on the web to the formula. – Justin C