Topic: Reference a Form's Field in a cfField?
Hello again folks,
.
Is it possible to reference a form's date field in a cfField formula?
.
Currently cfVacEarned is:
ifnull(employee.dateHireMod,0) +
case when round((julianday('now') - julianday(employee.dateHire))/(365/12)) > 180 then '20'
when round((julianday('now') - julianday(employee.dateHire))/(365/12))> 120 then '15'
when round((julianday('now') - julianday(employee.dateHire))/(365/12))> 60 then '10'
when round((julianday('now') - julianday(employee.dateHire))/(365/12))> 12 then '5'
else '0'
end
This is always referencing today's date.
.
I'm trying to allow users specify a date (mainly for reporting) via the new Date Point field. Something like this:
ifnull(employee.dateHireMod,0) +
case when round(({frmMain.dtpDatePoint.SqlDate} - julianday(employee.dateHire))/(365/12)) > 180 then '20'
when round(({frmMain.dtpDatePoint.SqlDate} - julianday(employee.dateHire))/(365/12))> 120 then '15'
when round(({frmMain.dtpDatePoint.SqlDate} - julianday(employee.dateHire))/(365/12))> 60 then '10'
when round(({frmMain.dtpDatePoint.SqlDate} - julianday(employee.dateHire))/(365/12))> 12 then '5'
else '0'
end
This doesn't work, but is there a way to do this? Or could someone offer ideas on how to accomplish it?
.
Thank you in advance,
-joshuA