1

I have .mdb Database, with sample data:

GameIndx|GameDate           |PlayerID|Duration|Score|
--------|-------------------|--------|--------|-----|
       1|2016-01-11 00:00:00|SM004   |     455| 2200|
       2|2016-01-12 00:00:00|SM004   |     241| 1952|
       3|2016-01-12 00:00:00|SV007   |     381| 1280|
       4|2016-01-12 00:00:00|LK001   |     372| 5237|

To run a SELECT to match a certain GameDate:

   SQL := 'SELECT GameIndx, GameDate from tblGames where GameDate=#2016/01/11#';

This statement works inside of Delphi, and returns the correct column. To my understanding this is not SQL syntax: Is there any documentation for Delphi regarding the accepted syntax for dates?

GameDate=#2016/01/11#
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Don Su
  • 129
  • 9

1 Answers1

1

You mention you're dealing with a .mdb i.e. a Microsoft Access database. MS Access is unusual amongst SQL databases in that it uses the '#' character as a delimiter for dates, so in this case GameDate=#2016/01/11# IS in fact valid SQL syntax and is nothing to do with Delphi.

user9601310
  • 1,076
  • 1
  • 7
  • 12
  • Thanks you pointed me in the right direction. https://stackoverflow.com/questions/21351259/what-is-the-purpose-of-these-number-signs-around-date-value-type – Don Su Sep 01 '20 at 06:47