Jump to content

Date format function


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 post
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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...