[AccessD] Pop-quiz: DateAdd() and negative time values

Gary Kjos garykjos at hotmail.com
Wed Nov 19 15:01:18 CST 2003


or f) None of the above?

it should be 12/29/1899 11:00 pm shouldn't it?

Gary Kjos
garykjos at hotmail.com





>From: Gustav Brock <gustav at cactus.dk>
>Reply-To: Access Developers discussion and problem 
>solving<accessd at databaseadvisors.com>
>To: Access Developers discussion and problem 
>solving<accessd at databaseadvisors.com>
>Subject: [AccessD] Pop-quiz: DateAdd() and negative time values
>Date: Wed, 19 Nov 2003 18:40:02 +0100
>
>Boring day.
>So here's a quick quiz to wake you up.
>
>The time value of #02:00 AM# equals
>
>    12/30/1899 02:00 AM
>
>What does - off your head - this expression return:
>
>? Format(DateAdd("h", -3, #02:00 AM#),"mm\/dd\/yyyy hh\:nn AM/PM")
>
>a) 12/30/1898 11:00 PM
>b) 12/30/1899 01:00 AM
>c) 12/30/1899 05:00 AM
>d) 12/30/1899 05:00 PM
>e) 12/30/1899 11:00 PM
>
>The tricky part is DateAdd(). Format(), it is only for ensuring a
>consistent format of the return value.
>
>Morale: Be careful with negative time values.
>
>/gustav
>
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com

_________________________________________________________________
Has one of the new viruses infected your computer?  Find out with a FREE 
online computer virus scan from McAfee. Take the FreeScan now!  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



More information about the AccessD mailing list