I
Iftekhar
I have the following installed on my PC:
OS Windows XP Home With SP2 (Fully Updated)
Access 2002 With SP3 (Fully Updated)
Regional & Language Options Short Date Format dd/MM/yy
Please consider the following queries:
Query 1:
SELECT TransDate, TransTime,
DateAdd('n', -1, TransTime) AS MinuteBefore,
DateAdd('n', 1, TransTime) AS MinuteAfter
FROM tblDT;
Output From the Above Query:
TransDate TransTime MinuteBefore MinuteAfter
30/01/06 11:59:00 PM 11:58:00 PM 31/12/1899
31/01/06 12:00:00 AM 29/12/1899 11:59:00 PM 12:01:00 AM
MinuteAfter in the first record and MinuteBefore in the second record show
strange results.
Query 2:
SELECT TransDate, TransTime,
FormatDateTime(TransDate + DateAdd('n', -1, TransTime), 0) AS MinuteBefore,
FormatDateTime(TransDate + DateAdd('n', 1, TransTime), 0) AS MinuteAfter
FROM tblDT;
Output From the Above Query:
TransDate TransTime MinuteBefore MinuteAfter
30/01/06 11:59:00 PM 30/01/06 11:58:00 PM 31/01/06
31/01/06 12:00:00 AM 29/01/06 12:01:00 AM 31/01/06 12:01:00 AM
MinuteBefore in the second record shows strange results.
tblDT contains only two fields i.e.
TransDate Type: Date/Time
TransTime Type: Date/Time
Nothing is set at table level.
Many thanks for reading. Any help / alternate would be appreciated.
OS Windows XP Home With SP2 (Fully Updated)
Access 2002 With SP3 (Fully Updated)
Regional & Language Options Short Date Format dd/MM/yy
Please consider the following queries:
Query 1:
SELECT TransDate, TransTime,
DateAdd('n', -1, TransTime) AS MinuteBefore,
DateAdd('n', 1, TransTime) AS MinuteAfter
FROM tblDT;
Output From the Above Query:
TransDate TransTime MinuteBefore MinuteAfter
30/01/06 11:59:00 PM 11:58:00 PM 31/12/1899
31/01/06 12:00:00 AM 29/12/1899 11:59:00 PM 12:01:00 AM
MinuteAfter in the first record and MinuteBefore in the second record show
strange results.
Query 2:
SELECT TransDate, TransTime,
FormatDateTime(TransDate + DateAdd('n', -1, TransTime), 0) AS MinuteBefore,
FormatDateTime(TransDate + DateAdd('n', 1, TransTime), 0) AS MinuteAfter
FROM tblDT;
Output From the Above Query:
TransDate TransTime MinuteBefore MinuteAfter
30/01/06 11:59:00 PM 30/01/06 11:58:00 PM 31/01/06
31/01/06 12:00:00 AM 29/01/06 12:01:00 AM 31/01/06 12:01:00 AM
MinuteBefore in the second record shows strange results.
tblDT contains only two fields i.e.
TransDate Type: Date/Time
TransTime Type: Date/Time
Nothing is set at table level.
Many thanks for reading. Any help / alternate would be appreciated.