You are here Support Forums
Search:  
SQL script doesn't return rows in SQL View, in VS2003 it does
Last Post 07 Sep 2006 03:01 PM by p jha. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
p jha
New Member
New Member
Posts:1

--
07 Sep 2006 03:01 PM  
Hi All, Why does a SQL script in VS2003 or in Enterprise Manager runs on my DNN database and returns rows while the same script doesn't return rows in the SQL View module (no errors). It only shows the table header with the column names: DateTime and Hours Ago This is the script i use: -------------------------------------------------- SELECT TOP 1 DateTime, CAST(DATEDIFF(minute, DateTime, GETDATE()) / 60.00 AS decimal(9, 2)) AS [Hours Ago] FROM dbo.SiteLog WHERE (PortalId = 2) AND (UserAgent LIKE '%googlebot%') ORDER BY DateTime DESC -------------------------------------------------- Do i need a XSL file for displaying data? Any help would be appreciated. Chau, Zit.
Richard Edwards
DNNStuff Founder
Veteran Member
Veteran Member
Posts:1207
Avatar

--
08 Sep 2006 01:10 PM  
No, you don't need any xsl file Chau. Try a simple query such as [code]SELECT * FROM dbo.Portals[/code] Does that work?


Richard Edwards
DNNStuff Founder
Did you receive excellent support? Consider leaving a testimonial
Sandro Seiler
New Member
New Member
Posts:1

--
23 Sep 2006 02:17 PM  
Hello. First I want to thank you for the samples and free modules you have published in your site.\ After using the SQL View module, I get no rows. I tried using the code SELECT * FROM dbo.Portals and this works fine, however the sample sql code you have to retrieve last googled info will not work. Any help is appreciated. F10
Richard Edwards
DNNStuff Founder
Veteran Member
Veteran Member
Posts:1207
Avatar

--
23 Sep 2006 08:55 PM  
Ok, I think I know now. In the code you are using, it specifies portal 2 which is my portal number but it may not be the same for yours. In that code, replace the 2 with [DNN:PortalId] which will insert the portal id into your query string. The query should look like: [code]SELECT TOP 1 DateTime, CAST(DATEDIFF(minute, DateTime, GETDATE()) / 60.00 AS decimal(9, 2)) AS [Hours Ago] FROM dbo.SiteLog WHERE (PortalId = [DNN:PortalId]) AND (UserAgent LIKE '%googlebot%') ORDER BY DateTime DESC[/code]


Richard Edwards
DNNStuff Founder
Did you receive excellent support? Consider leaving a testimonial
You are not authorized to post a reply.

Active Forums 4.1
Privacy StatementTerms Of UseCopyright (c) 2004-2012 DNNStuff