Jump to content

Date format function


vchris

Recommended Posts

Can't you just substitute "CURRENT_TIMESTAMP" for the name of the column which stores the date?Rather than:

SELECT TIME(CURRENT_TIMESTAMP);

Use something like:

SELECT TIME(creation_date);

Link to comment
Share on other sites

DBMS = DataBase Management System (e.g. MySQL, MSSQL, MS Access).What about

SELECT MONTHNAME(date_field) AS month, DAYOFMONTH(date_field) AS date, YEAR(date_field) AS year FROM table

where date_field is of type DATE. Then you could use PHP to further format it.

Link to comment
Share on other sites

[Macromedia][sqlServer JDBC Driver][sqlServer]'MONTHNAME' is not a recognized function name.SQL:SELECT NPRI_ID, Comp_Name, Faci_Name, ProgramRef, MONTHNAME(closure) AS month, DAYOFMONTH(closure) AS date, YEAR(closure) AS year FROM QM3_Facility WHERE NPRI_ID LIKE '%06067' AND ReportYear = '2006'

Link to comment
Share on other sites

convert(date,closure,107) AS closureType date is not a defined system type.convert(varchar,closure,107) AS closureWorks but does not display correct style (2006.07.00). There seems to be a 00 value for the day. Can this query work with this 00 value?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...