Solved

MySQL Date operators

Posted on 2013-06-24
4
387 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

631 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