Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Trying to return day of week name

Author  Topic 

kdnichols
Posting Yak Master

232 Posts

Posted - 2006-11-13 : 13:00:38
Hello Everyone,

I am trying to return the day of week as a name in the form of Mon, Tue, Wed, Thu, Fri, Sat, Sun the field is called DateReceived.

Can anyone shed some light on this for me. Do I create a new field because if I use =DATENAME(dw, DateReceived) I receive an error that it canot find the function DATENAME.

This is probably a stupid question to most, but where should I declare the DATENAME function. I am relatively new to SSRS.

TIA

Have a great day!



Kurt

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-13 : 16:02:43
See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=74862


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

kdnichols
Posting Yak Master

232 Posts

Posted - 2006-11-13 : 16:08:36
Hello Peso and Everyone,

At long last here is the answer I was looking for similar to what Peso was alluding to but it is the WeekdayName Function.

Here is my answer:


=WeekDayName(WeekDay( Fields!DateReceived.Value ()), 1)


Obviously DateReceived is my date field.

This will return the day as Mon, Tue, Wed, etc.

Hope this will help someone else down the road.

Kurt
Go to Top of Page

gpinkham
Starting Member

2 Posts

Posted - 2006-12-01 : 14:55:57
What about translation. Does it translate the weekday name? I tried this with setting the language property to user!language and logged in as French.. All of the Report Services UI shows French but the data column with Week day names in still show English (Mon, Tue etc..)

Gary
Go to Top of Page

kdnichols
Posting Yak Master

232 Posts

Posted - 2006-12-08 : 13:37:56
Hello,

I think you need to check your language settings on your pc or server settings.

Kurt
Go to Top of Page

gpinkham
Starting Member

2 Posts

Posted - 2006-12-08 : 13:46:14
quote:
Originally posted by kdnichols

Hello,

I think you need to check your language settings on your pc or server settings.

Kurt



What I ended up doing was adding the User!Language to the report's attributes and removing it from the individual fields. Once I did this the WeekDayName function returned the proper translation (French, English or Chinese)...

Thanks!
Go to Top of Page

kdnichols
Posting Yak Master

232 Posts

Posted - 2006-12-21 : 09:54:13
Hello,

I am glad even I was able to help somene out for a change!

Glad it worked for you!

Cheers,

Kurt
Go to Top of Page

ulfemsoy
Starting Member

2 Posts

Posted - 2011-10-12 : 14:48:22
If you only want to get the day index (sunday = 0, monday=1, etc.), you should check the following description:
[url]http://www.lazerwire.com/2011/10/sql-day-of-week.html[/url]
Go to Top of Page
   

- Advertisement -