Solved

Change date created if date modified = Today

Posted on 2008-11-03
4
202 Views
Last Modified: 2008-11-04
Basically

If t0.U_IIS_REF2 = TODAYS DATE
I want to change that records t0.createdate to todays date

Thanks

Keir
0
Comment
Question by:KeirMcCann
  • 2
4 Comments
 
LVL 37

Expert Comment

by:momi_sabag
ID: 22868001
update table1
set createdate = getdate()
where U_IIS_REF2 = getdate()
0
 
LVL 37

Expert Comment

by:momi_sabag
ID: 22868005
what is the format of dates you work with?
0
 

Author Comment

by:KeirMcCann
ID: 22868012
DD.MM.YY

Thanks

Keir
0
 
LVL 40

Accepted Solution

by:
Sharath earned 500 total points
ID: 22872444
Run Momi's query. If that does n't work, then run the below query.

update table1
set createdate = CONVERT(varchar(10), GETDATE(), 4)
where U_IIS_REF2 = CONVERT(varchar(10), GETDATE(), 4)
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

759 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now