1
Hello, I have a table where there are the following fields.
prod_id [int 11]
prod_nome [varchar 100]
prod_desc [textarea]
prod_valor [double 10,2]
prod_data_cadastro [datetime]
I need to create a SELECT which shows the time spent until the current date using the column record prod_data_cadastro [datetime].
I tried so:
SELECT *, DATEDIFF(NOW(), `prod_data_cadastro`) as `data_corrida` FROM `produto` ORDER BY `data_corrida` DESC;
But returns me only the amount of running days, hours and minutes no, it is possible to bring date and time too?
Can give an example with a date and what you expect the result.
– Caique Romero
@Guilhermecostamilam The issue you passed deals with SQL Server and not about Mysql. Hug!
– Fabiano Monteiro
Possible duplicate of Difference between two dates in days, hours, minutes and seconds
– rLinhares
@But there, the question talks about the database is SQL Server
– Fabiano Monteiro