Wednesday, March 7, 2012

BUG- DATEPART(ww) DATENAME (ww) SPANISH

Hi,
I think this is a bug:
set language spanish
select datepart (ww,'01/04/2000')
select datename (ww,'01/04/2000')
go
Changed language setting to Espa?ol.
14
(1 row(s) affected)
14
************* It′s OK. Because I query the same thing.
select datepart (ww,'04/11/2000')
select datename (ww,'04/11/2000')
go
45
(1 row(s) affected)
45
(1 row(s) affected)
************* It′s OK. Because I query the same thing.
select datepart (ww,'09/04/2000')
select datename (ww,'09/04/2000')
go
15
(1 row(s) affected)
16
(1 row(s) affected)
************ WHY t-sql with language spanish produces different results wit
h datename y datepart to '09/04/2000'?Books Online say that DATEPART will take into account the setting of SET
DATEFIRST, but it doesn't say anything like that for DATENAME. My guess is
that the problem lies here somewhere. Anyhow, note that SQL Server does not
produce week numbers as per the ISO standard! This is why MS added the
ISOWeek function as an example in SQL Server 2000's Books Online.
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Jose Antonio Pineda" <anonymous@.discussions.microsoft.com> wrote in message
news:9B0DA440-ADB3-468F-9BFA-455437036D4B@.microsoft.com...
> Hi,
> I think this is a bug:
> set language spanish
> select datepart (ww,'01/04/2000')
> select datename (ww,'01/04/2000')
> go
>
> Changed language setting to Espaol.
> --
> 14
> (1 row(s) affected)
>
> --
> 14
> ************* Its OK. Because I query the same thing.
> select datepart (ww,'04/11/2000')
> select datename (ww,'04/11/2000')
> go
> --
> 45
> (1 row(s) affected)
>
> --
> 45
> (1 row(s) affected)
>
> ************* Its OK. Because I query the same thing.
>
> select datepart (ww,'09/04/2000')
> select datename (ww,'09/04/2000')
> go
> --
> 15
> (1 row(s) affected)
>
> --
> 16
> (1 row(s) affected)
> ************ WHY t-sql with language spanish produces different results
with datename y datepart to '09/04/2000'?
>

No comments:

Post a Comment