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
 Transact-SQL (2000)
 Passing a null value to a timestamp column

Author  Topic 

dougancil
Posting Yak Master

217 Posts

Posted - 2011-02-18 : 15:09:45
I have the following query

insert into exceptionsedit
select employeenumber, exceptiondate, starttime, endtime, duration, code, approvedby, approved, time from exceptions
where exceptiondate between '5/1/2010' and '5/8/2010'

and I'm trying to place a null value for the time column. Where would that value go in my query?

Thank you

Doug

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-02-18 : 15:11:29
insert into exceptionsedit
select employeenumber, exceptiondate, starttime, endtime, duration, code, approvedby, approved, null from exceptions
where exceptiondate between '5/1/2010' and '5/8/2010'
Go to Top of Page

dougancil
Posting Yak Master

217 Posts

Posted - 2011-02-18 : 15:43:00
Thanks Rob,

I knew it was something simple.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-02-21 : 03:20:16
Also make sure to use unambigious date format YYYYMMDD in the queries

Madhivanan

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

- Advertisement -