Gary Kjos
garykjos at gmail.com
Fri Apr 28 06:55:09 CDT 2006
Hi Gustav, When I was typing my reply I did use the # characters around the date instead of the " but I was swayed when I looked for the help file to verify that the indicator tor seconds in dateadd was 's'. I saw that they had the double quotes around the date in the example so I went that way too even though it seemed wrong. Thanks for pointing out the possible issues. Gary On 4/28/06, Gustav Brock <Gustav at cactus.dk> wrote: > Hi Gary and Rocky > > Just a note: If possible, you should use a date value and not its string representation with DateAdd() even though the example uses a string: > > Format(DateAdd("s",[date],#1/1/1970#),"Short Date") > > It doesn't make much of a difference here but in other situations it might as the string will be converted to a date value using the local date/time settings. That will not happen for a date value. > > /gustav > > >>> bchacc at san.rr.com 28-04-2006 04:01 >>> > Gary: > > Works perfectly! I'm using Expr1: > Format(DateAdd("s",[date],"1/1/70"),"Short Date") just to get the date > only so I can count the hits by date. > > Thank you. > > Rocky > > > Gary Kjos wrote: > > Hi Rocky, > > > > If the Unix Epoch date represents a number of seconds from a magic > > point in time, how about if if you did a dateadd function with the > > field containing the number of seconds to added the magic date with > > the result being the date in date format from where you can store it > > or do further fun stuff with it.. It would be something like > > > > OutputDateField = DateAdd("s", lngUnixEpochDateInput, "1/1/1970") > > > > Dateadd is described here... > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vafctdateadd.asp > > > > That is what I would probably do anyway. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com