Doug Steele
dbdoug at gmail.com
Tue Sep 6 21:06:08 CDT 2011
Thanks, Gustav - I know you've gone over this many times before! In this particular case, I was just typing into the immediate window, and I had checked that the computer's Windows date format was mm/dd/yyyy. When I use the Weekday function in code, I always use Date/Time variables. Doug On Mon, Sep 5, 2011 at 11:17 PM, Gustav Brock <Gustav at cactus.dk> wrote: > Hi Doug > > Weekday("9/4/2011") and Weekday(#9/4/2011#) is not the same thing so if > that computer doesn't use the "reverse" US date format (mm/dd/yyyy) your > expression will read as 2011-04-09. > > Always use data type date/time for dates in VB(A). > > /gustav > > > >>> dbdoug at gmail.com 05-09-2011 18:19 >>> > Hello All: > > I have some code which depends on the weekday number. On all computers > except for one of my client's, it runs OK. The computers are a mixed bag > of > Access 2003, 2010 and Windows 7 and Vista. > > On the 'bad' computer, everything is off by one day. Debugging on this > computer gives '7' as the result of Weekday("9/4/2011") - a Sunday. > According to Access help, the default for Sunday is 1. I've checked the > Windows 7 Regional and Language settings on this computer and 'Sunday' is > set as the first day of the week. So Access and Windows are different. > > I can't find a setting in Access to change this, and nothing on the Web. > But it must be some kind of configuration setup - does anyone have a > suggestion? > > Thanks, > Doug > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com >