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.

 All Forums
 SQL Server 2000 Forums
 Analysis Services (2000)
 Blank Dates in SQL Server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-07-11 : 06:15:24
Steve writes "Hi SQLTeam

I have just found your site (looks very interesting BTW) so thought I would challenge you with this - coz I can't hack it!

I have a database (data warehouse) with tables containing date columns for transactions potentially in the future e.g. expected despatch date and actual despatch date. Obviously at any point in time the Actual date will be blank in the underlying transaction system for those order lines not yet despatched. These come through as NULL in SQL Server.

However, we need those transaction lines in an OLAP cube, so we cannot allow those columns to be NULL where the event has yet to take place. In the SQL Server db I have tried using the ISNULL function to substitute '', ' ', '00/00/0000', 0 and '00/00/00 00:00:00.000' for the nulls, but either get error messages or it defaults to '01/01/1900'.

Is it possible to put something like a blank into a datetime column, not'01/01/1900' or NULL, so that we can get the transaction into the OLAP cube? (The users think '01/01/1900' is misleading, especially when made available to partners outside of the business).

We use SQL Server 2000 SP3a.

Many thanks,
Steve

PS Thanks for the FAQ re images in SQL Server - very timely!"

Kristen
Test

22859 Posts

Posted - 2005-07-11 : 09:18:18
Nope. For a datetime datatype you have to have a valid date, or NULL.

Strikes me that's the function of NULL actually

Kristen
Go to Top of Page
   

- Advertisement -