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 2005 Forums
 Transact-SQL (2005)
 how to restrict '01-01-1900' values

Author  Topic 

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-12-15 : 06:35:00
hi in one date column values are null i dont want to insert those null values as ot is giving '01-01-1900' straight awat.

even though i put condition also it is inserting those like
IF( isnull(@LAST_PERIOD_DATE),'')<>!='' OR LEN(RTRIM(LTRIM(@LAST_PERIOD_DATE)))>0 )

how to write a condition here please help me in this.

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-12-15 : 06:39:46
IF @LAST_PERIOD_DATE IS NOT NULL
BEGIN

END
Go to Top of Page

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2009-12-15 : 06:57:39
even though i give condition also am getting the same values
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-12-15 : 07:29:46
quote:
Originally posted by rajasekhar857

hi in one date column values are null i dont want to insert those null values as ot is giving '01-01-1900' straight awat.

even though i put condition also it is inserting those like
IF( isnull(@LAST_PERIOD_DATE),'')<>!='' OR LEN(RTRIM(LTRIM(@LAST_PERIOD_DATE)))>0 )

how to write a condition here please help me in this.


Why are you starting the new thread?
What about your opinions about this thread?
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=137135

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -