Solved

MySQL Date operators

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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