How to change the date format in a DB aware combo box?
-
27-09-2019 - |
Question
I'm using TwwDbLookupComboDlg
component. I want to change the date format in the combobox (as shown below) from 1/1/2009
to Jan 2009
, any idea?
Solution
Change the TDateField's DisplayFormat :
with Table1 do
TDateField(FieldByName('Date1')).DisplayFormat:='mmm yyyy';
OTHER TIPS
If you are using a dataware control, you can format the field data using the DisplayFormat
property.
TDateTimeField(ADODataSet1.FieldByName('START_DATE')).DisplayFormat:='mmm-yyyy';
I haven't worked with this component but I think when you're filling up the combo, for each field in the list you can use shortmonthnames
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow