DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Databases > SQL Development

Discuss "Return Default Date If Null" in the SQL Development forum.

SQL Development - Structured Query Language (SQL) is the talk of databases. Discuss topics such as joins, triggers and other advanced SQL topics.


Reply « Previous Thread | Next Thread »
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old June 6th, 2008, 01:09 PM
mehere's Avatar
Mistress of Sarcasm

 
Join Date: Mar 2008
Location: Wide Awake In Dreamland
Posts: 111
Thanks: 8
Thanked 19 Times in 17 Posts
Rep Power: 1
mehere is on a distinguished road

Awards Showcase
Microsoft SQL Server Classic ASP 
Total Awards: 2

Default

oh that's easy wolffy ... kill the designer. that's always the answer.
__________________
Quote of the Month:
Strife: As long as we have each other, we'll never run out of problems.

Questions to Ponder:
Should vegetarians eat animal crackers?

iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright © 2008 sbenj69
Reply With Quote
Sponsored Links
  #12 (permalink)  
Old June 6th, 2008, 01:18 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 530
Thanks: 14
Thanked 38 Times in 37 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead is on a distinguished road

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

I'd have to agree.

Wolffy, in .Net I tried handling the date problem by passing the NULL value from the date field through a constructor of my class which has a Nullable Of DateTime property. Unfortunately, you can't pass a NULL value to a Nullable property for some reason

Anyway, I wanted to handle this via the query that I have to hard code.

However, I've been in touch with some DBA's trying to get this issue resolved.
__________________
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
Reply With Quote
  #13 (permalink)  
Old June 6th, 2008, 01:55 PM
Rebelle's Avatar
Contributing Member

 
Join Date: Mar 2008
Posts: 157
Thanks: 29
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

Quote:
Originally Posted by Wolffy View Post
Hmm, y'all seem to be posting in circles here JMH & mehere . Obviously sumpin' gotta change sumplace, so which would you like to do:
(a) Change the data
(b) Change the query
(c) Handle the null in code
(d) Write a sproc
(e) Kill the DB designer
?
I vote for (e)
Reply With Quote
  #14 (permalink)  
Old June 6th, 2008, 01:58 PM
Wolffy's Avatar
Slaprentice of Wolves


 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 146
Thanks: 1
Thanked 23 Times in 20 Posts
Rep Power: 1
Wolffy is on a distinguished road

Awards Showcase
Microsoft .Net 
Total Awards: 1

Default

Yeah, I tried to use Nullable<Date> as well, and found it to be too big a pain in the fistookis. Went with Date.MinValue where a null was needed. Now, how did I do that...hmmm.
__________________
Wolffy
------------------------
Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary.
Reply With Quote
  #15 (permalink)  
Old June 7th, 2008, 09:13 PM
lewy's Avatar
Dark Sonic Master

 
Join Date: Mar 2008
Location: Edinburg, TX
Posts: 34
Thanks: 0
Thanked 3 Times in 3 Posts
Rep Power: 1
lewy is on a distinguished road
Default

c'mon just convince your boss to let you kill the db designer
Are you sure it wasn't you

I'd get rid of the null values.
Isn't there anything you can do to fill in the null values?
Something like filling in those values with the actual data?

Once I run into something similar, but fortunately, once I started asking about the hired dates
It so happened that someone had another db where these values were and all I had to do
was import this into the db with nulls and problem solved.

Ask around, who knows, perhaps someone has this data
__________________
................... ASCII and ye shall receive ..................
Knowledge is the only resource on earth that multiplies when shared

If you found a post helpful, please click the 'Thanks' button in the lower right-hand corner of the post.
Reply With Quote
  #16 (permalink)  
Old June 8th, 2008, 09:27 AM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 530
Thanks: 14
Thanked 38 Times in 37 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead is on a distinguished road

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

Okay, so I brought it up during my application demo and the guy who is above all DBA's said, "NULL is bad".

So at least him and I are on the same page. Hopefully we can come up with some solution. One of the databases that my app uses, unfortunately, is not under his control and the lady who is in charge of the data is a complete possessive b!tch. So that's my next hurdle.
Reply With Quote
  #17 (permalink)  
Old June 8th, 2008, 10:30 PM
lewy's Avatar
Dark Sonic Master

 
Join Date: Mar 2008
Location: Edinburg, TX
Posts: 34
Thanks: 0
Thanked 3 Times in 3 Posts
Rep Power: 1
lewy is on a distinguished road
Default

Quote:
Originally Posted by jmurrayhead View Post
... and the lady who is in charge of the data is a complete possessive b!tch. So that's my next hurdle.
So now we know who you're gonna kill lol
Just ask her to create a query using her null values and tell her see if she understands
thru that thick skull of hers that you just can't have a null date of hire
Reply With Quote
Reply

  DeveloperBarn Forums > Databases > SQL Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

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


All times are GMT -4. The time now is 07:39 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46