[AccessD] Access date problem

Gustav Brock Gustav at cactus.dk
Tue Sep 6 01:17:23 CDT 2011


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





More information about the AccessD mailing list