B
bobby
I have developed Access applications for some time but this is one of the
weirdest problems ever.
On a form I have 2 independent subforms both showing similar data and
showing the same problem. On each form I display some weekly data based on a
stored procedure. The stored procedure looks like
SELECT
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 1 THEN Hours
ELSE 0 END)) AS Sunday,
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 2 THEN Hours
ELSE 0 END)) AS Monday,
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 3 THEN Hours
ELSE 0 END)) AS Tuesday,
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 4 THEN Hours
ELSE 0 END)) AS Wednesday,
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 5 THEN Hours
ELSE 0 END)) AS Thursday,
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 6 THEN Hours
ELSE 0 END)) AS Friday,
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 7 THEN Hours
ELSE 0 END)) AS Saturday,
CONVERT(Numeric(9, 2), SUM(Hours )) AS TotalWeek
FROM dbo.tblMyTable
WHERE (MyDate BETWEEN @StartDate AND @EndDate)
To put it in another way; I produce a recordset with 7 fields, one for each
day of the week. The Hours field does a sum for each date.
This works absolutely fine nearly always. But I have installed this on a
machine abroad (Denmark) where a Danish version of Access is installed and
this is where things go wrong. On this client machine data gets bound to the
wrong field (control source). On the form I have fields named Monday through
Sunday. The following happens:
Should be MONDAY is bound to SUNDAY.
Should be TUESDAY is bound to MONDAY.
Should be WEDNESDAY is bound to TUESDAY.
Should be THURSDAY is bound to WEDNESDAY.
Should be FRIDAY is bound to THURSDAY.
Should be SATURDAY is bound to FRIDAY.
Should be SUNDAY is bound to SATURDAY.
I figure this has something to do with the international first day of week.
In the US Sunday is the first day of the week, whereas Monday is the first
day of the week in Denmark. But I can't see how it influences in this case
because the stored procedure is executed on the server. Is SQL server so
clever that when it sees the call comes from a Danish client machine, it
will overrule the server setting of "first day of week" thus creating a
different recordset?
On clients where International runtime is installed things work fine.
I would appreciate any comments and suggestions.
weirdest problems ever.
On a form I have 2 independent subforms both showing similar data and
showing the same problem. On each form I display some weekly data based on a
stored procedure. The stored procedure looks like
SELECT
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 1 THEN Hours
ELSE 0 END)) AS Sunday,
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 2 THEN Hours
ELSE 0 END)) AS Monday,
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 3 THEN Hours
ELSE 0 END)) AS Tuesday,
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 4 THEN Hours
ELSE 0 END)) AS Wednesday,
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 5 THEN Hours
ELSE 0 END)) AS Thursday,
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 6 THEN Hours
ELSE 0 END)) AS Friday,
CONVERT(Numeric(9, 2), SUM(CASE DATEPART(weekday, MyDate) WHEN 7 THEN Hours
ELSE 0 END)) AS Saturday,
CONVERT(Numeric(9, 2), SUM(Hours )) AS TotalWeek
FROM dbo.tblMyTable
WHERE (MyDate BETWEEN @StartDate AND @EndDate)
To put it in another way; I produce a recordset with 7 fields, one for each
day of the week. The Hours field does a sum for each date.
This works absolutely fine nearly always. But I have installed this on a
machine abroad (Denmark) where a Danish version of Access is installed and
this is where things go wrong. On this client machine data gets bound to the
wrong field (control source). On the form I have fields named Monday through
Sunday. The following happens:
Should be MONDAY is bound to SUNDAY.
Should be TUESDAY is bound to MONDAY.
Should be WEDNESDAY is bound to TUESDAY.
Should be THURSDAY is bound to WEDNESDAY.
Should be FRIDAY is bound to THURSDAY.
Should be SATURDAY is bound to FRIDAY.
Should be SUNDAY is bound to SATURDAY.
I figure this has something to do with the international first day of week.
In the US Sunday is the first day of the week, whereas Monday is the first
day of the week in Denmark. But I can't see how it influences in this case
because the stored procedure is executed on the server. Is SQL server so
clever that when it sees the call comes from a Danish client machine, it
will overrule the server setting of "first day of week" thus creating a
different recordset?
On clients where International runtime is installed things work fine.
I would appreciate any comments and suggestions.