[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

changing julian dates in sql 2008 via transaction

Posted on 2011-05-11
2
Medium Priority
?
435 Views
Last Modified: 2012-05-11
I have the following dates in  table showing the 16 of the each month. I need to make this the 28th of each month. There are over 50 of them to change and I don;t wish to change one by one.

eg 734304 needs to change to 734316

please see file attached


change-dates.xlsx
0
Comment
Question by:Amanda Walshaw
  • 2
2 Comments
 
LVL 41

Accepted Solution

by:
ralmada earned 2000 total points
ID: 35742972
why not something like

update yourtable
set yourdatecolumn = yourdatecolumn + 12
0
 
LVL 41

Expert Comment

by:ralmada
ID: 35743028
or if the table contains other dates including the one showing the 16 of the month

update yourtable
set yourdatecolumn = yourdatecolumn + 12
where day(dateadd(d, yourdatecolumn, '1899-12-31')) = 16
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Screencast - Getting to Know the Pipeline

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question