![]() |
| |||||||
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
| ||||
| I have a query like the following: Code: "SELECT " & _
[last_name]," & _
[first_name]," & _
[hire_date]," & _
"FROM vw_people " & _
"WHERE id = @id"
Anyway, is there a way via my above query to return a default date if "hire_date" is NULL? I'm using SQL Server 2000. This is a hard coded query unfortunately and I'm not sure if I can do some sort of SELECT CASE here.
__________________ jmurrayhead Did I help you out? Make me popular by clicking the icon!If you found a post helpful, please click the button in the lower right-hand corner of the post.Powered by ASP.Net |
| Sponsored Links |
| ||||
| try something like this Code: "SELECT " & _
[last_name]," & _
[first_name]," & _
CASE WHEN [hire_date] IS NULL THEN 'default_date' ELSE [hire_date] END AS hire_date," & _
"FROM vw_people " & _
"WHERE id = @id"
__________________ Quote of the Month: Sanity: Minds are like parachutes. Just because you've lost yours doesn't mean you can borrow mine. Questions to Ponder: Why is the third hand on the watch called the second hand? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright © 2008 sbenj69 |
| ||||
| That's the problem. For some reason certain .Net methods won't accept NULL dates. Which is why I'm trying to return a default value before it gets to the method. ![]() |
| ||||
| Quote:
![]() And believe me, I'd much rather rid myself of NULL in this database, but that is not up to me, unfortunately. |
| ||||
| Quote:
When you said 'change your query', I was confused as that was a vague statement. So I'm assuming there is no way to do what I want and I'm going to have to put my right boot on when I go talk to the database morons. ![]() |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| No Default Member Found for type | richyrich | .Net Development | 5 | May 29th, 2008 01:33 PM |
| Webform Default Button | Devwhiz | .Net Development | 9 | May 15th, 2008 01:15 PM |
| Sponsored Links |
| ASP.NET Resource Index a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer. Free Web Directory Including Chats and Forums Resources, Offer automatic, instant and free directory submissions. | URLZ Web Directory URLZ Web Directory Free Web Directory - Add Your Link The Little Web Directory | Free Web Directory Pegasus free web directory is a free directory organised by categories. Web Directory & SEO Services dirroot web directory |