Jump to content
Sign in to follow this  
tiko165

Converter data sem traços e com texto

Recommended Posts

tiko165

O que eu pretendo fazer no MySQL, é calcular uma data à dois 2 meses (Hoje - 2 meses) e a isso, juntar ainda algum texto.

» Data à 2 meses = "2016-05-19".

Resumindo, supondo esta data, queria juntar texto, e a data sem traços.

Resultado final seria +/- isto "Texto20160519".

Como poderei faze-lo?


collectioneuro300px.png

Share this post


Link to post
Share on other sites
HappyHippyHippo

select CONCAT('Texto', REPLACE('2016-05-19', '-', '')) as result;
[/Code]

  • Vote 1

IRC : sim, é algo que ainda existe >> #p@p

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.