thehandsomecode Posted January 12, 2011 Share Posted January 12, 2011 Hello all, I need some help to figure this one out. I am trying to type a where clause to gather the following Here are the fields assigneddate : datetoclose I need to pull all records where the "assigneddate" is less than todays date and "datetoclose" is sometime in the future. however if the "datetoclose" field is empty i do not want it to evaluate the "datetoclsoe" is somewhere inthe future string. In that case I only want it to parse the "assigneddate" is less than today's date. Please help. Quote Link to comment https://forums.phpfreaks.com/topic/224197-help-with-a-where-clause-date/ Share on other sites More sharing options...
Maq Posted January 12, 2011 Share Posted January 12, 2011 Try something like this: SELECT * from [table] WHERE (datetoclose = '') OR (assigneddate [today]) If your datetoclose is default to null then change the logic to 'datetoclose IS NULL'. Quote Link to comment https://forums.phpfreaks.com/topic/224197-help-with-a-where-clause-date/#findComment-1158405 Share on other sites More sharing options...
thehandsomecode Posted January 12, 2011 Author Share Posted January 12, 2011 Thank you.. you steared me in the right direction and i was able to sort it out. Quote Link to comment https://forums.phpfreaks.com/topic/224197-help-with-a-where-clause-date/#findComment-1158444 Share on other sites More sharing options...
Maq Posted January 12, 2011 Share Posted January 12, 2011 Thank you.. you steared me in the right direction and i was able to sort it out. Np, glad you sorted it out. Quote Link to comment https://forums.phpfreaks.com/topic/224197-help-with-a-where-clause-date/#findComment-1158451 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.