Developer forum

Forum » Templates » DBPub - Top 2 rows

DBPub - Top 2 rows


Reply

How do I only get the 2 latest postings from a table using DBPub. The DBPub makes its own SQL like this - how can I modify/make another?


 


"select * from [weblogarticle] t1   where t1.[weblogarticledraft] <> true  order by t1.[weblogarticledate] desc"


 


Replies

 
Nicolai Høeg Pedersen
Reply
mfh@haug-it.dk wrote:


How do I only get the 2 latest postings from a table using DBPub. The DBPub makes its own SQL like this - how can I modify/make another?




 




"select * from [weblogarticle] t1   where t1.[weblogarticledraft] <> true  order by t1.[weblogarticledate] desc"




 





 


On the first tab, Datasource, check the "Use custom sql" check box and specify your own SQL.

 
Reply

Found out - Perfect:



select top 2 weblogarticleid, weblogarticleheadline, weblogarticledescription from weblogarticle   where weblogarticledraft <> true order by weblogarticledate desc

 

You must be logged in to post in the forum