Jump to content

Search the Community

Showing results for tags 'date_format'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. Hi All, So I am using this query to return some values.: $Find_Query2 = mysql_query("SELECT patients.*, addobs.* FROM addobs INNER JOIN patients ON addobs.MRN = patients.MRN WHERE addobs.datetime = (SELECT MAX(OLAST.datetime) FROM addobs AS OLAST WHERE OLAST.MRN = patients.MRN) AND addobs.par > 6 AND NOT addobs.hidden = 'yes' AND COALESCE(patients.ward,'') != 'dc' order by addobs.par ASC"); However, i one of the values ('datetime') is in the php datetime format yyyy-mm-dd hh:ii:ss. I want to return this in a different format dd/mm/yyyy hh:ii:ss. I tried using DATE_FORMAT as thats what i usually use to do this but i think my syntax is wrong as it is returning no results for 'datetime' in the way i am using it. I think im getting confused with my brackets somewhere. $Find_Query2 = mysql_query("SELECT patients.*, addobs.* FROM addobs INNER JOIN patients ON addobs.MRN = patients.MRN WHERE addobs.datetime = (SELECT DATE_FORMAT(MAX(OLAST.datetime), '%d/%m/%Y %H:%i:%s') FROM addobs AS OLAST WHERE OLAST.MRN = patients.MRN) AND addobs.par > 6 AND NOT addobs.hidden = 'yes' AND COALESCE(patients.ward,'') != 'dc' order by addobs.par ASC"); Can anybody tell me what im doing wrong here? Thanks in advance for any help, Matt
  2. Im trying to create a repeated list of all the years forms have been filled in, in my database. The database has been running for 4 years and the row creation_date is unixtime. I want a list that looks as follows 2010 2011 2012 2013 to create this list I understand Im after creation_date between the highest and lowest value of Year in unixtime. So I wrote the following query mysql_select_db($database_dbconnet, $dbconnet); $query_rs_frmyear = sprintf("SELECT creation_date FROM customer_details WHEREcreation BETWEEEN (SELECT MIN(DATE_FORMAT(FROM_UNIXTIME(creation_date), 'Y')) AS lowyear FROM customer_details)AND (SELECT MAX(DATE_FORMAT(FROM_UNIXTIME(creation_date), 'Y')) AS highyear FROM customer_details)"); $rs_frmyear = mysql_query($query_rs_frmyear, $dbconnet) or die(mysql_error()); //echo the yearsdo {echo $row_rs_frmyear['creation_date']; } while($row_rs_frmyear = mysql_fetch_assoc($rs_frmyear)); Which fell flat on its face!!! Any ideas anyone?
×
×
  • Create New...

Important Information

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.