Products
KDB-X
Next-gen kdb+ for real-time, historical, and AI apps, providing fast analytics across all data with q, Python, and SQL.
Explore → Documentation
KDB.AI
Vector database optimized for unstructured and time-series data.
Insights Enterprise
Low-code integrated, scalable data management & analytics.
Insights SDK
Developer toolkit for creating custom time series analytics applications.
Delta
Integrated platform for enterprise-scale, high-security data management and analytics.
Add-ons Overview
Dashboards
Custom interactive data visualization tool to query, transform, share and present live data insights.
VS Code Extension
Extension to create and edit q files, connect to multiple data processes, and execute queries.
Accelerators
Pre-built, customizable solutions for faster data projects.
What is the correct way to create tables with date types?
q)tt:(d:2019.05.262019.05.25`2019.04.01; j:1 2 3)
2019.05.26
q)tt
d j
2019.05.26 1
2019.05.25 2
2019.04.01 3
q)meta tt
c| t f a
-| -----
d| s
j| j
q)tt:(d:“D”$“2019.05.26” “D”$“2019.05.25” “D”$“2019.04.01”; j:1 2 3)
1
2
3
q)
( d: 2019.05.26 2019.05.25 2019.04.01; j:1 2 3)
It can be done directly as the other response stated. It is also possible to use symbols or strings, as you attempted. With strings, you can cast (tok) the list of strings in one operation:
([]d:"D"$("2019.05.26";"2019.05.25";"2019.04.01"); j:1 2 3)
Similarly, if you have symbols you can cast the symbols to strings and do the same:
([]d:"D"$string 2019.05.262019.05.252019.04.01; j:1 2 3)`
([]d:"D"$string
2019.05.25