Moving from DBF to SQL. When I did this before (to SQLite) I converted the DBF dates to strings:
09/10/2021 becomes "20210910"
The table column was an 8-space Char type. Easy to convert and fairly easy to adjust the programming logic throughout the app.
My question is:
Is this the way to do it going forward, or should I use another approach?
Trying to use a common date format that works across all SQL database types.
Thanks everyone.
Best Practices: Date conversion
Best Practices: Date conversion
Joe Curran
Ohio USA
Ohio USA
Best Practices: Date conversion
Joe,
I think it is better to use the ISO Date type for the SQL column. The syntax is: YYYY-MM-DD
VO 2.8 Sql Class Library has DToCSQL(dDate) to convert VO date to a SQL Date. You may also create your own functions to handle date and time values.
for example:
Using SQL date columns will make it to sort and query the data using SQL statements.
Jamal
I think it is better to use the ISO Date type for the SQL column. The syntax is: YYYY-MM-DD
VO 2.8 Sql Class Library has DToCSQL(dDate) to convert VO date to a SQL Date. You may also create your own functions to handle date and time values.
for example:
Code: Select all
? DToCSQL(Today()) // returns: 2021-09-10
Jamal