我需要在Linq中使用SqlFunctions
從Date取得年份和星期。使用Linq中的Sql函數一起獲取年份和星期
For example:Date="01/12/2014", I need to get 2014-48
我能得到week from SqlFunctions.DatePart("ww",Date)
和year from SqlFunctions.DatePart("yyyy",Date)
,但如何將其結合起來,yyyy-ww
或取爲yyyy-ww
?
是否有可能得到這個比使用SqlFunctions
?
在此先感謝。
我假設你使用的是實體框架,對嗎? – IronMan84
@ IronMan84,是的 – Cherry
哪周的數字? ISO? –