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.
| Author |
Topic |
|
JDP12345
Starting Member
4 Posts |
Posted - 2011-06-20 : 16:48:22
|
| Hello>I have a date statement that I need to display the day of the week.=DateAdd("h",-4,DateAdd("s",CInt(Left(Fields!SubmittedDate.Value,10)),"1970-01-01 00:00:00")) & " EST"CURRENT RESULT: MM/DD/YYYY 4:10:44 PM ESTNEED: Monday MM/DD/YYYY 4:10:44 PM ESTIs there any way to tweak the DateAdd code to allow for MondayThe Submitted Date is NVARCHAR(10) and looks like this when it returns values in the table 1038600098039 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
JDP12345
Starting Member
4 Posts |
Posted - 2011-06-20 : 17:12:04
|
| Thanks Tara for getting back to me. This is an expression that I'm using in an SSRS report. Is there another way to interpret the statement to produce Monday MM/DD/YYYY 4:10:44 PM ESTThanks |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-06-20 : 17:18:09
|
| In Microsoft's t-SQL you can use the datename functionselect datename(weekday,getdate())JimEveryday I learn something that somebody else already knew |
 |
|
|
JDP12345
Starting Member
4 Posts |
Posted - 2011-06-20 : 17:25:45
|
| Thanks for the post but datename is not recognized as a SSRS expression. |
 |
|
|
JDP12345
Starting Member
4 Posts |
Posted - 2011-06-20 : 17:50:04
|
| I have resolved the issue with this statement=DateAdd("h",-4,DateAdd("s",CInt(Left(Fields!SubmittedDate.Value,10)),"1970-01-01 00:00:00")).ToString("dddd MM/dd/yyyy hh:mm:ss tt") & " EST" |
 |
|
|
|
|
|
|
|