1 (edited by CDB 2020-01-01 08:21:01)

Topic: Some code to display a SQL date as a named month

I'm sure there is an easier way to do this, but wanting to be different, I prefer to show my dates in a tablegrid as '01 Jan 2020' instead of 01/01/2020.

After spending a large part of my day trying to figure it out, I have succeeded with the code below. Note this uses a Calculated field to convert the date from SQL format to my preferred display format.

strftime('%d ', rec_date)||(substr("--JanFebMarAprMayJunJulAugSepOctNovDec",strftime('%m', rec_date)*3,3)|| strftime(' %Y', rec_date))

Replace 'rec_date' with the column name in your database that contains your date.

Hope someone might find it useful.

On a clear disk you can seek forever

2 (edited by derek 2020-01-01 11:35:50)

Re: Some code to display a SQL date as a named month

Hi CDB,
I've never seen it done like that before but it's neat and compact.
Thanks.

Re: Some code to display a SQL date as a named month

Thanks  CDB,
It's verry simple... I already try and success