?
Solved

Update query to current date

Posted on 2011-10-25
9
Medium Priority
?
171 Views
Last Modified: 2012-05-12
Hi,

I want to update my date to the current date.

this is the format I have in the database.
2011-08-05
2011-09-10

            Update ADS
            set (AdsStatus = 1),
            (AdsDate = getdate())
            where AdsID = #URL.AdID#
0
Comment
Question by:lulu50
  • 6
  • 3
9 Comments
 
LVL 15

Expert Comment

by:Eyal
ID: 37023215
what is AdsDate field type ?
0
 

Author Comment

by:lulu50
ID: 37023221
AdsDate field type is Date
0
 
LVL 15

Expert Comment

by:Eyal
ID: 37023229
the query is ok. do you get some kind of error?
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 

Author Comment

by:lulu50
ID: 37023237
Syntax error or access violation: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(AdsStatus = 1), (AdsDate = getdate()) where AdsID = 4' at line 2
0
 
LVL 15

Accepted Solution

by:
Eyal earned 1500 total points
ID: 37023243
try

 Update ADS
            set AdsStatus = 1,
            AdsDate = getdate()
            where AdsID = #URL.AdID#
0
 

Author Comment

by:lulu50
ID: 37023264
General error: FUNCTION lulu50_ChurchesBulletin.getdate does not exist
0
 

Author Comment

by:lulu50
ID: 37023268
Update ADS
            set AdsStatus = 1,
            AdsDate = CURRENT_DATE()
            where AdsID = #URL.AdID#
0
 

Author Comment

by:lulu50
ID: 37023270
there is no getdate  functio in mysql

Current_date() worked.

thanks,
0
 

Author Closing Comment

by:lulu50
ID: 37023273
Thanks,
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

862 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