Kexi/Plugins/Queries/SQL Constants: Difference between revisions
No edit summary |
|||
(15 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
Grammar - two versions: | Grammar - two versions: | ||
* ISO format (KEXI default, recommended) | |||
# | #yyyy-mm-dd# | ||
* US format (for compatibility, based on MSA default [https://msdn.microsoft.com/en-us/library/bb221200(v=office.12).aspx]) | |||
# | #mm/dd/yyyy# | ||
Notes: | |||
*Both formats are not dependent on regional settings on the OS, they are always interpreted the same way | |||
*One or two digits are required for month and day, e.g. #2018-4-15# and #2018-04-1# are both valid dates | |||
*Four digits are required for year, e.g. #18-4-15# is invalid date | |||
*MSA's format such as #24 Dec 2014# is not supported. | |||
*Detailed grammar of VBA: https://msdn.microsoft.com/en-us/library/dn528865.aspx | |||
== Time constants == | == Time constants == | ||
Grammar - two versions: | Grammar - two versions: | ||
* Full | |||
# | #hh:nn:ss# | ||
* Short | |||
# | #hh:nn# | ||
Notes: | |||
* One or two digits are required; e.g. both #05:59:01# and #5:59:1# are time literals having the same value | |||
* 24 hour mode is only supported, that is no AM/PM suffix can be used | |||
== Date/Time constants == | == Date/Time constants == | ||
Line 24: | Line 35: | ||
Grammar: | Grammar: | ||
#{ | #{date} {time}# | ||
Where {date} is defined as for Date literals and {time} is defined as for Time literals. | |||
Notes: | |||
*All notes regarding date and time format also apply to data and time parts of the value |
Revision as of 15:58, 15 April 2018
Date constants
(since 3.1.1, Bug #393094)
Grammar - two versions:
- ISO format (KEXI default, recommended)
#yyyy-mm-dd#
- US format (for compatibility, based on MSA default [1])
#mm/dd/yyyy#
Notes:
- Both formats are not dependent on regional settings on the OS, they are always interpreted the same way
- One or two digits are required for month and day, e.g. #2018-4-15# and #2018-04-1# are both valid dates
- Four digits are required for year, e.g. #18-4-15# is invalid date
- MSA's format such as #24 Dec 2014# is not supported.
- Detailed grammar of VBA: https://msdn.microsoft.com/en-us/library/dn528865.aspx
Time constants
Grammar - two versions:
- Full
#hh:nn:ss#
- Short
#hh:nn#
Notes:
- One or two digits are required; e.g. both #05:59:01# and #5:59:1# are time literals having the same value
- 24 hour mode is only supported, that is no AM/PM suffix can be used
Date/Time constants
(since 3.1.1, Bug #393094)
Grammar:
#{date} {time}#
Where {date} is defined as for Date literals and {time} is defined as for Time literals.
Notes:
- All notes regarding date and time format also apply to data and time parts of the value