Solved

MySQL Date operators

Posted on 2013-06-24
4
376 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can I iterate through mysql tables to alter character set? 3 60
Clean text to insert in database 9 52
CheckListBox usage 3 51
xampp tool 12 26
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

12 Experts available now in Live!

Get 1:1 Help Now