Topic: Format a Calculated Field
Hi All,
I'm trying to SORT a tblGrid using a Calculated Field. But it's not working. Here's what I have:
.
OPTION 1
calcNextSvcDate =
strftime('%m/%d/%Y',date(julianday((select max(SvcDate) from tbl_Service
where tbl_Service.id_tbl_Equip = tbl_Equip.id)) + (select SvcInterval
from tbl_Svc_Interval where tbl_Equip.id_tbl_Svc_Interval = tbl_Svc_Interval.id)))
.
OPTION 2
calcYMDnextSvcDate =
strftime('%Y/%m/%d',date(julianday((select max(SvcDate) from tbl_Service
where tbl_Service.id_tbl_Equip = tbl_Equip.id)) + (select SvcInterval
from tbl_Svc_Interval where tbl_Equip.id_tbl_Svc_Interval = tbl_Svc_Interval.id)))
.
When I use calcNextSvcDate the tblGrid does not sort by this column.
When I use calcYMDnextSvcDate it is working OK.
.
So that's good news for the SORTING issue. However my problem is that the dates in the cells for option 2 are showing as Y m d and since I'm in the US, I would like it to show m d Y
.
First, is there any way to format the data in the cells in OPTION 2 ?
Second, is maybe my approach to the SORTING issue maybe not the correct way to do it ?
.
Thanks
Frank