SET DATEFIRST ignored by adp

R

Raymond Geering

Hello

I'm running Access XP (German) along MSDE on an english Win2k server
and I seem to have a problem with the DATEFIRST.

The query SELECT @@DATEFIRST AS 'FirstWeekday' returns 7
in my SQL (MSDE) environment.

But the same query returns 1 in my Access project (adp).

The interesting thing is that it always returns 1, even if I use the
SET DATEFIRST command on my SQL server to set it e.g.
to 2, 5 or whatever.

So how can I tell my access to use sunday as the first day of
week instead of monday?

It's even more interesting that the weekday() function within a
mdb file will return 7 which is correct.

I checked google and noticed that somebody had a similiar problem
with a danish Access version. But I didn't find a solution there.

Hope somebody can help me in this matter.

/Ray
 
S

Sylvain Lafontaine

ADP opens three connection and these connections are pooled; so it will be
hard for you to reset this option in a permanent way.

You must reset the option each time you make a call, either in batch mode or
in a stored procedure:

SELECT @@DATEFIRST AS 'FirstWeekday'
SET DATEFIRST 2
SELECT @@DATEFIRST AS 'FirstWeekday'

Another option would be to change the language used for the Login account to
Deutsch, which will set the DateFirst to 1 as the default for that account.
See sp_helplanguage for more info.
 
R

Raymond Geering

Hello Sylvain,

Thanks for your reply.

I tried different language settings and I even modified the setting
for German, English and whatever.

In the end, I simply decided to rewrite the query.

/Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top