Background
Quick follow-up to our last post on String Representation of datetime.
Referenced Post
BTW, that post is here:
Db/2 – LUW – SQL Error [22007]: “The string representation of a datetime value is out of range”
Link
Goal
In this post we will discuss options for displaying date columns in “locale” sensitive ways.
Implementation
Dbeaver
Query
SQL Server
When we issue a query that looks like the one below :-
Sample
select tblSD.name as [name] , tblSD.create_date as [createTS] , cast(tblSD.create_date as date) as [createDate] from sys.databases tblSD
Output
Explanation
- Columns
- createDate
- Values
- 2003-04-08
- Representation
- YYYY-MM-DD
- ISO
- Values
- createDate
Dbeaver Configuration
Objective
Let us configure our JDBC Connection
Steps
- From the left panel, choose Data Source
- Right click on Data Source
- Select Properties
- In Properties Window
- In the left window, select “Result Sets” \ “Data Formats”
- In the Data Formats window
- Tick the checkbox to grant us the opportunity to modify
- Customize per your needs
- Locale
- Language :- en-English
- Country :- US – United States
- Locale :- en_US
- Format
- Type :- Date
- Pattern :- MMM-dd-yyyy
- Locale
Data Formats
Data Formats – Date
Original
Revised
Data Formats – Other
Please keep in mind we are able to customize other data types, as well.
Inclusive are Date time types ( Date, Time, Timestamp ) and Numbers.
Query
SQL Server
If we go back and re-issue our query, here is what it will look like:
Output
Explanation
Our dates now look like Month-Day-Year.
References
- Dbeaver
- dbeaver/dbeaver
- Dates from DB2 on IBM i are displayed as “null” #2948
Opened By / On Date :- savadgecayet commented on Feb 8
Link
- Dates from DB2 on IBM i are displayed as “null” #2948
- dbeaver/dbeaver