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 |
|
jpradeep
Starting Member
8 Posts |
Posted - 2006-11-08 : 06:15:17
|
| Hi AllThis is my queryselect dateadd(d,Targetdays,BookingDate) as TargetDate from Bookings b, Clients c where b.intClientID=c.intClientIDHere BookingDate is DateTime field and belongs to Bookings Tableand Targetdays is int field and belongs to Clients TableTargetDate should display BookingDate + TargetDaysUpto here everything okay.Incase TargetDays contains NULL value or value '0' then it should display BookingDate + 1 dayHow to do it in SQL Query?Thanks in AdvancePradeep |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-11-08 : 06:22:28
|
| [code]select dateadd(d, case IsNull(Targetdays,0) when 0 then 1 else Targetdays end,BookingDate) as TargetDate from Bookings b, Clients c where b.intClientID=c.intClientID[/code]Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
jpradeep
Starting Member
8 Posts |
Posted - 2006-11-08 : 06:35:47
|
| Hi HarshThanQ very much for your help. ThanksPradeep |
 |
|
|
|
|
|