SQL Clone
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 Eights!
SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)

Group: General Forum Members
Points: 915 Visits: 955
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
SSC-Forever
SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)

Group: General Forum Members
Points: 41074 Visits: 20000
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 Eights!
SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)

Group: General Forum Members
Points: 915 Visits: 955
no , i want to change those orders value to null [that column data type is datetime ]
Eugene Elutin
Eugene Elutin
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12286 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 Eights!
SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)

Group: General Forum Members
Points: 915 Visits: 955
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 Eights!
SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)

Group: General Forum Members
Points: 915 Visits: 955
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
SSCertifiable
SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)

Group: General Forum Members
Points: 6209 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
SSC-Forever
SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)

Group: General Forum Members
Points: 41074 Visits: 20000
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
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12286 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 Eights!
SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)SSC Eights! (915 reputation)

Group: General Forum Members
Points: 915 Visits: 955
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