Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 05-22-2013, 07:15 AM
stephen001 stephen001 is offline
Contributing Member
 
Join Date: 04-25-13
Posts: 89
iTrader: 0 / 0%
Is there anything wrong with my Query

I am confused, I am trying to filter data based on the lastweek field, but query is partially working

SELECT `EmployeeID` ,`lastweek` FROM `employeedb`WHERE `ReportingTo` = 'John' AND 'lastweek' > '2013-05-17';



this query fetches all the records where Manager is John, I dono why 2nd condition is not getting executed



is there issue with this statement ?



'lastweek' > '2013-05-17' ?

is there anything wrong with the above query, why it only works partially



Thanks
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 05-22-2013, 12:11 PM
eagle12 eagle12 is offline
Contributing Member
 
Join Date: 11-30-11
Posts: 137
iTrader: 0 / 0%
What is the datatype of the lastweek field?
 
Reply With Quote
  #3  
Old 05-23-2013, 12:27 AM
stephen001 stephen001 is offline
Contributing Member
 
Join Date: 04-25-13
Posts: 89
iTrader: 0 / 0%
Quote:
Originally Posted by eagle12 View Post
What is the datatype of the lastweek field?
it is date type
 
Reply With Quote
  #4  
Old 05-23-2013, 01:59 AM
stephen001 stephen001 is offline
Contributing Member
 
Join Date: 04-25-13
Posts: 89
iTrader: 0 / 0%
one of the forum member told to use DATE before lastweek then the query worked

SELECT EmployeeID, lastweek
FROM employeedb
WHERE ReportingTo = 'John'
AND DATE(lastweek) BETWEEN '2013-05-05' AND '2013-05-19'
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Query about SMM bobwarner01 SEO Forum 6 11-04-2011 11:30 PM
Wrong Traffic, Wrong Keyword for Wrong Site! Jonathan_Hue SEO Forum 22 03-18-2008 05:33 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 06:00 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC