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 |
|
gbeford
Starting Member
9 Posts |
Posted - 2009-08-28 : 12:15:56
|
| I am tring to create a query where if the stopDate is older then today or the value is null in the table it will give me just those results... however i seem to have a syntax error that I am just not seeing ? can someone help ? its only at the Or isnull line if i remove it the query will runselect TL_DSRV_KMA_PhoneList.ID, SortOrder, KMA_LongDesc, KMA_ID, DispatchLocation, [Sys], Prin, [Site], Co_Div, Name, Title, OfficeNumber, Extention, CellNumber, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, StartHour, EndHour, Notes, TL_DSRV_KMA_PhoneList.StartDate, TL_DSRV_KMA_PhoneList.StopDatefrom TL_DSRV_KMA_PhoneList join TL_KMA_Reference on KMA_ID = TL_KMA_Reference.IDwhere TL_DSRV_KMA_PhoneList.StopDate >= getdate() OR isnull TL_DSRV_KMA_PhoneList.StopDateThanksGina |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-08-28 : 13:00:33
|
| OR TL_DSRV_KMA_PhoneList.StopDate IS NULLJim |
 |
|
|
gbeford
Starting Member
9 Posts |
Posted - 2009-08-28 : 13:14:53
|
| Thank you so much... :) i have been pulling my hair out with this one |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-08-28 : 13:20:55
|
| You're welcome. ISNULL is actually it's own functionISNULL(Column,'a') returns an 'a' if Column is nullJim |
 |
|
|
|
|
|
|
|