This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Guys, This is probably fairly rare? But when using linq like... var query = from p in unitOfWork.WpPosts
where p.PostStatus == "publish" && p.PostType == "post"
group p by new {PostYear = p.PostDate.Year, PostMonth = p.PostDate.Month } into yg
select new WordPressArchive
{
Year = yg.Key.PostYear,
Month = yg.Key.PostMonth,
NumberOfArticles = yg.Count()
};
SQL like this is produced... SELECT
g1.post_date
FROM
(
SELECT
YEAR(wp_posts.post_date) AS "post_date",
MONTH(wp_posts.post_date) AS "post_date"
FROM
wp_posts wp_posts
WHERE
(wp_posts.post_status = 'publish' AND wp_posts.post_type = 'post')
GROUP BY
YEAR(wp_posts.post_date),
MONTH(wp_posts.post_date)
)
g1
I was using MySQL as the DB when getting this error - not tested on any other DBs. But as you can see, the year part and the month part both have the same field name alias which is causing issues. Cheers |
|
|
|
|
Thanks for reporting this - we have added in a candidate fix for this which will be available in the next nightly build (20110608). Let us know if there are any lingering issues on this one.
Jeremy |
|
|
|