Solved

MySQL Date operators

Posted on 2013-06-24
4
373 Views
Last Modified: 2013-06-24
I am creating a view and need to restrict the record set to a greater or equal to a date.

I am using below but is returning all

select        
        `tblpermit`.`PermitIssueDate` AS `PermitIssueDate`
    from
        `tblpermit`
    where
        (`tblpermit`.`PermitIssueDate` >= ((6 / 19) / 2013))

Open in new window


The date format on the returned records is long time
0
Comment
Question by:Brogrim
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:Jagadishwor Dulal
ID: 39271251
select        
        `tblpermit`.`PermitIssueDate` AS `PermitIssueDate`
    from
        `tblpermit`
    where
        `tblpermit`.`PermitIssueDate` >= '6 /19/ 2013'

Open in new window

0
 

Author Comment

by:Brogrim
ID: 39271319
Not working.

the date format returned are 2010-07-01 00:00:00
0
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 500 total points
ID: 39271352
Use same date format in your query and later you can format date:
select        
        `tblpermit`.`PermitIssueDate` AS `PermitIssueDate`
    from
        `tblpermit`
    where
        `tblpermit`.`PermitIssueDate` >= ' 2010-07-01'

Open in new window

0
 

Author Closing Comment

by:Brogrim
ID: 39271376
Thanks
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of articles have been written on splitting mysqldump and grabbing the required tables. A long while back, when Shlomi (http://code.openark.org/blog/mysql/on-restoring-a-single-table-from-mysqldump) had suggested a “sed” way, I actually shell …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now