Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 sql problem request with variables
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

3 Posts

Posted - 02/13/2013 :  09:11:43  Show Profile  Reply with Quote
In my table , i've a field "ad_datededepartoccasionnel". The content is a date in text format (I can't change it's format) dd-mm-yyyy. I must edit ads by descending order, but it's sort by day.
So I want to permute dd with yyyy

I Tried this code but an error occurs at UPDATE string. I 'm not a programmer, therefore I ask some help.
this is the code below

SELECT @annee := SUBSTR(ad_datededepartoccasionnel,7,4),@jour := SUBSTR(ad_datededepartoccasionnel,1,2)FROM cov_adsmanager_ads
UPDATE cov_adsmanager_ads SET ad_datededepartoccasionnel= REPLACE(ad_datededepartoccasionnel,@annee,@jour)
UPDATE cov_adsmanager_ads SET ad_datededepartoccasionnel= REPLACE(ad_datededepartoccasionnel,@jour,@annee)

Sorry for my english


Starting Member

3 Posts

Posted - 02/13/2013 :  10:56:12  Show Profile  Reply with Quote
Sorry it's not a field but a column
Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 02/13/2013 :  11:15:26  Show Profile  Reply with Quote
this doesnt look like t-sql. whats the rdbms that you're using?

This is ms sql server forum so if you're using something else you may be better off posting them in relevant forums.

SQL Server MVP

Go to Top of Page

Starting Member

3 Posts

Posted - 02/13/2013 :  11:37:23  Show Profile  Reply with Quote
I use Xampp with(apache, phpmyadmin).in which forum must be my question ?
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000