What is the purpose of these number signs around date value type?

后端 未结 2 1747
再見小時候
再見小時候 2021-01-01 08:04

Can anyone explain the correct usage/requirement of using these \'#\' number signs. Do they simply have to surround any date type in SQL?

Thanks

SELE         


        
相关标签:
2条回答
  • 2021-01-01 08:46

    These are the MS Access syntax for date constants.

    In most other databases, you just use a string to represent a date. In my opinion, you should use one of the ISO standard formats for this (either YYYYMMDD or my preference YYYY-MM-DD). So a valid date in most databases would be '2014-01-01'. In Access, this can be written #2014-01-1#.

    0 讨论(0)
  • 2021-01-01 08:50

    I suppose that is a vendor specific SQL modification. If I am not mistaken, that is specific for MS Access databases that the date should be delimited with a hash.

    0 讨论(0)
提交回复
热议问题