Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
asifbhura
Posting Yak Master
165 Posts |
Posted - 2006-07-08 : 05:09:22
|
| DearI have created a stored procedure with 1 parameter like below.CREATE PROCEDURE SP_news_date( @news_date datetime) AS -- For local news -0 SELECT top 4 * from allnews where news_name='news' and sub_name='Kingdom' and en_date=@news_date ORDER BY en_date DESC-- For Middle East new -1 SELECT top 4 * from allnews where news_name='news' and sub_name='Middle East' and en_date=@news_date order by en_date DESC--For Asia News - 2 SELECT top 4 * from allnews where news_name='news' and sub_name='Asia' and en_date=@news_date order by en_date DESC--For International news - 3 SELECT top 4 * from allnews where news_name='news' and sub_name='International' and en_date=@news_date order by en_date DESChere i am passing @news_date = today's date now,I want some programming for IF there is nothing for today then it must fetch yesterday's records,Please help me outWaiting for replyregards,ASIF |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-07-08 : 05:36:51
|
| and en_date <= @news_date order by en_date DESCPeter LarssonHelsingborg, Sweden |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-07-10 : 02:50:21
|
| >>IF there is nothing for today then it must fetch yesterday's records,Only yesterday's records or all previous days records?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|