
Originally Posted by
Warren Ashcroft
IMHO, the best way to handle a date is in the YYYY-MM-DD format, and you can use the date field for that.
True - it works the same on US and UK servers and you can use the DateDiff function etc.
The main reason I use a number is that my code is the same whatever the database - no syntax changes for different db types is necessary.
eg. instead of adding hashes for sql queries to Access:
Code:
SELECT * FROM tbl_payments WHERE pay_bank_date = #2005-09-07#
I can use:
Code:
SELECT * FROM tbl_payments WHERE pay_bank_date = 20050907
which works on MSSQL too.
Bookmarks