DayOfWeek function does not seem correct
Author Message
DayOfWeek function does not seem correct

Greetings

If wkYear = "03"
and wkMonth = "4"
and wkDay = "29"

and April 29th, 03 is a Tuesday
Then why does the following formula return a 1. I dont see how Tuesday
could be the first day of the week :

dayOfWeek(date(tonumber(wkYear),tonumber(wkMonth),tonumber(wkDay)))

is returning a 1, I would expect a 2

Thanks

Jeff

Sat, 15 Oct 2005 00:17:42 GMT
DayOfWeek function does not seem correct
Jeff,

This could be a quirk of your regional settings.  You can set a default to
determine which day SQL Server uses as the first day of the week, e.g.
sunday, monday etc.  You can also overrise this default only for the
duration of a single query.  For more information, look up dayofweek on
books online.

Hope this helps,
Paul

Quote:
> Greetings

> If wkYear = "03"
> and wkMonth = "4"
> and wkDay = "29"

> and April 29th, 03 is a Tuesday
> Then why does the following formula return a 1. I dont see how Tuesday
> could be the first day of the week :

> dayOfWeek(date(tonumber(wkYear),tonumber(wkMonth),tonumber(wkDay)))

> is returning a 1, I would expect a 2

> Thanks

> Jeff

Sat, 15 Oct 2005 00:22:52 GMT
DayOfWeek function does not seem correct
if wkYear is really 3 that is probably the problem...it needs to be
2003...also as I recall regional settings don't apply here...the Crystal
week is always sun thru sat

Quote:
> Greetings

> If wkYear = "03"
> and wkMonth = "4"
> and wkDay = "29"

> and April 29th, 03 is a Tuesday
> Then why does the following formula return a 1. I dont see how Tuesday
> could be the first day of the week :

> dayOfWeek(date(tonumber(wkYear),tonumber(wkMonth),tonumber(wkDay)))

> is returning a 1, I would expect a 2

> Thanks

> Jeff

Sun, 16 Oct 2005 00:59:55 GMT

 Page 1 of 1 [ 3 post ]

Relevant Pages