Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


how to change the date value to null??


how to change the date value to null??

Author
Message
Lavanyasri
Lavanyasri
SSC Veteran
SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)

Group: General Forum Members
Points: 235 Visits: 937
hi ,

I have a column with date datatype. i updated the column with some date like 02-02-2012 00.00.000 ,for 100 orders Now i want to change the value for those 100 orders to NULL . how can i change ???


Thanks
lavanya
ChrisM@Work
ChrisM@Work
SSCrazy Eights
SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)

Group: General Forum Members
Points: 9025 Visits: 19036
Lavanyasri (8/17/2012)
hi ,

I have a column with date datatype. i updated the column with some date like 02-02-2012 00.00.000 ,for 100 orders Now i want to change the value for those 100 orders to NULL . how can i change ???


Thanks
lavanya


Looks like a datetime datatype?

Do any orders other than the 100 you've just changed have the same value in the column?
Do you have auditing columns on the table (e.g. LastModifiedDatetime, LastModifiedBy)?

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Lavanyasri
Lavanyasri
SSC Veteran
SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)

Group: General Forum Members
Points: 235 Visits: 937
no , i want to change those orders value to null [that column data type is datetime ]
Eugene Elutin
Eugene Elutin
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3046 Visits: 5478
Lavanyasri (8/17/2012)
hi ,

I have a column with date datatype. i updated the column with some date like 02-02-2012 00.00.000 ,for 100 orders Now i want to change the value for those 100 orders to NULL . how can i change ???


Thanks
lavanya


Are these 100 orders can be identified as WHERE [column] = '20120202' or this one will return more than 100 orders you want to set to NULL?

_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Lavanyasri
Lavanyasri
SSC Veteran
SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)

Group: General Forum Members
Points: 235 Visits: 937
table name :xyz coulumname is :submitdate datatype is : datetime

Initially submitdate by default is null

i updated the column for 100 orders to '02-02-2012 00.00.000'

update xys set submitdate='02-02-2012 00.00.000' where id in ('1','2'.........'100')

Now i want to revert back those 100 orders submitdate value to null .
Lavanyasri
Lavanyasri
SSC Veteran
SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)

Group: General Forum Members
Points: 235 Visits: 937
table name :xyz coulumname is :submitdate datatype is : datetime

Initially submitdate by default is null

i updated the column for 100 orders to '02-02-2012 00.00.000'

update xys set submitdate='02-02-2012 00.00.000' where id in ('1','2'.........'100')

Now i want to revert back those 100 orders submitdate value to null .
HowardW
HowardW
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1211 Visits: 9892
This sounds a really simplistic question, but based on what you've said, it should just be:

update xys set submitdate=NULL where id in ('1','2'.........'100')



I feel I must be missing something as surely if you know how to set the rows to one value, you know how to set it to another...
ChrisM@Work
ChrisM@Work
SSCrazy Eights
SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)

Group: General Forum Members
Points: 9025 Visits: 19036
HowardW (8/17/2012)
This sounds a really simplistic question, but based on what you've said, it should just be:

update xys set submitdate=NULL where id in ('1','2'.........'100')



I feel I must be missing something as surely if you know how to set the rows to one value, you know how to set it to another...


If I could find an emoticon for perplexed, it would be right here!

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Eugene Elutin
Eugene Elutin
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3046 Visits: 5478
ChrisM@Work (8/17/2012)
HowardW (8/17/2012)
This sounds a really simplistic question, but based on what you've said, it should just be:

update xys set submitdate=NULL where id in ('1','2'.........'100')



I feel I must be missing something as surely if you know how to set the rows to one value, you know how to set it to another...


If I could find an emoticon for perplexed, it would be right here!


Let me guess: OP has closed the window with the list of real id's he updated

... where id in ('1','2'.........'100')



Now he tries to get it back from us...

My question was: would the query SELECT * FROM orders WHERE SubmittedDate = '20120202' return 100 records or else?

_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Lavanyasri
Lavanyasri
SSC Veteran
SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)

Group: General Forum Members
Points: 235 Visits: 937
Thanks to all
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search