Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsntext and varcharntext and varchar
Previous
 
Next
New Post
2/1/2011 5:28 PM
 
Hi All,

I am trying to use the reports module to pull the last 5 blog entries from a particular blog (something the recent entries module as part of the blog suite does not) The issue arrises when I try to grab the description (or summary) I get "The data types ntext and varchar are incompatible in the add operator"

This is what I have a the moment which gives me the title and a read more link.

select top 5
ble.Title+'<a href="'+PermaLink+'">'+'Read More'+'</a>'
as [Latest Blog Entries]
from blog_entries ble
inner join blog_blogs bb on bb.Blogid = ble.Blogid
where ble.Published = 1
and bb.Portalid = @portalID
and bb.BlogID = 24
order by ble.AddedDate desc

What I want is to includ ble.Description but when I do I get the error above. I am only a basic user of the reports module and would appreciate any pointers.

TIA.
 
New Post
2/1/2011 5:51 PM
 
which of the columns is defined to be ntext? you may use substring to convert it into nvarchar.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
2/1/2011 7:29 PM
 
You can do something like this...
select top 5
CAST(ble.Description as nvarchar(max))+'Read More'
as [Latest Blog Entries] 
from blog_entries ble
inner join blog_blogs bb on bb.Blogid = ble.Blogid
where ble.Published = 1
and bb.Portalid = @portalID
and bb.BlogID = 24
order by ble.AddedDate desc

Will Morgenweck
VP, Product Management
DotNetNuke Corp.
 
New Post
2/5/2011 7:51 AM
 
Will Morgenweck wrote:
You can do something like this...
select top 5
CAST(ble.Description as nvarchar(max))+'Read More'
as [Latest Blog Entries] 
from blog_entries ble
inner join blog_blogs bb on bb.Blogid = ble.Blogid
where ble.Published = 1
and bb.Portalid = @portalID
and bb.BlogID = 24
order by ble.AddedDate desc

 Thanks for the reply Will.

If I wanted to have the title as per my original post displaying first i.e. the title then the summary and then the read more link how would I do this. I have tried the below and a number of varitiations but I cannot get it to work.

One other question would be, what is the easiest way to format the output. I am very fimiliar with css and html. (not with queries as you can tell)

select top 5
ble.Title
CAST(ble.Description as nvarchar(max))+'<a href="'+PermaLink+'">'+'Read More'+'</a>'
as [Latest Blog Entries] 
from blog_entries ble
inner join blog_blogs bb on bb.Blogid = ble.Blogid
where ble.Published = 1
and bb.Portalid = @portalID
and bb.BlogID = 24
order by ble.AddedDate desc

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsntext and varcharntext and varchar


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out