Solved

SQL Query into LINQ (DATENAME)

Posted on 2009-05-07
4
846 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:dishanf
  • 2
  • 2
4 Comments
 
LVL 25

Expert Comment

by:reb73
Comment Utility
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:dishanf
Comment Utility
I Think, DATENAME function not supported by LINQ
0
 
LVL 8

Author Comment

by:dishanf
Comment Utility
Hi reb73, This doesn't work.
0
 
LVL 25

Accepted Solution

by:
reb73 earned 125 total points
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now