?
Solved

SQL Query into LINQ (DATENAME)

Posted on 2009-05-07
4
Medium Priority
?
897 Views
Last Modified: 2013-11-26
Hi Experts,
Is there any equivalent LINQ query for this SQL?
 
SELECT DATENAME(mm,Date), DATENAME(dw,Date)
FROM Order

Thanks
Dishan

0
Comment
Question by:Dishan Fernando
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 25

Expert Comment

by:reb73
ID: 24323941
Not 100% sure if this'll work, but something like this should do it -


Dim query = From o In Order _
            Select  MonthName = o.Date.Value.ToString("MMM") _
		,WeekDayName  = o.Date.Value.DayOfWeek.ToString()

Open in new window

0
 
LVL 8

Author Comment

by:Dishan Fernando
ID: 24324320
I Think, DATENAME function not supported by LINQ
0
 
LVL 8

Author Comment

by:Dishan Fernando
ID: 24324353
Hi reb73, This doesn't work.
0
 
LVL 25

Accepted Solution

by:
reb73 earned 375 total points
ID: 24324405
No, not the DATENAME function as such is not supported by LINQ language reference, but you should be able to apply VB.NET/C# functions to returned values..
0

Featured Post

Amazon Web Services EC2 Cheat Sheet

AWS EC2 is a core part of AWS’s cloud platform, allowing users to spin up virtual machines for a variety of tasks; however, EC2’s offerings can be overwhelming. Learn the basics with our new AWS cheat sheet – this time on EC2!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question