AV1611 Posted September 27, 2005 Share Posted September 27, 2005 I need to change this to ROHS_PROCESS on or after a date... SELECT * FROM lbryperm WHERE TEK_PART_NUMBER LIKE '$PartNo' and ROHS_PROCESS LIKE 'yes' Sorry to be such a noob... Dates always mess me up Quote Link to comment Share on other sites More sharing options...
neylitalo Posted September 27, 2005 Share Posted September 27, 2005 I need to change this to ROHS_PROCESS on or after a date... Please clarify... I'm confused. Quote Link to comment Share on other sites More sharing options...
AV1611 Posted September 27, 2005 Author Share Posted September 27, 2005 Currently, the field ROHS_PROCESS contains YES or NO. We are going to change it to a date so we can plan on when the flag is set, in stead of it being manually set... I need the query to display on or after a date instead of the YES this it currently displays by... Please clarify... I'm confused. 300113[/snapback] Quote Link to comment Share on other sites More sharing options...
obsidian Posted September 27, 2005 Share Posted September 27, 2005 I need to change this to ROHS_PROCESS on or after a date... SELECT * FROM lbryperm WHERE TEK_PART_NUMBER LIKE '$PartNo' and ROHS_PROCESS LIKE 'yes' Sorry to be such a noob... Dates always mess me up 300110[/snapback] i would think you could simply do: [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--] [span style=\"color:#0000BB\"]<?php $sql [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#DD0000\"]\"SELECT * FROM lbryperm WHERE TEK_PART_NUMBER LIKE \'$PartNo\' AND ROHS_PROCESS >= \'\" [/span][span style=\"color:#007700\"]. [/span][span style=\"color:#0000BB\"]date[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\'Y-m-d\'[/span][span style=\"color:#007700\"]) . [/span][span style=\"color:#DD0000\"]\"\'\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"]?> [/span] [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] this fills in the SQL format of the DATE field with todays date. Quote Link to comment Share on other sites More sharing options...
AV1611 Posted September 27, 2005 Author Share Posted September 27, 2005 Wouldn't that always return TRUE because you are comparing to todays date, not the date in the record? I was thinking the answer would be: [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--] [span style=\"color:#0000BB\"]<?php $sql [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#DD0000\"]\"SELECT * FROM lbryperm WHERE TEK_PART_NUMBER LIKE \'$PartNo\' AND ROHS_PROCESS >= \"[/span][span style=\"color:#0000BB\"]$_POST[/span][span style=\"color:#007700\"][[/span][span style=\"color:#DD0000\"]\'DATE\'[/span][span style=\"color:#007700\"]][/span][span style=\"color:#DD0000\"]\"; ?>[/span] [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] Would that be right? i would think you could simply do: [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--] [span style=\\\"color:#0000BB\\\"]<?php $sql [/span][span style=\\\"color:#007700\\\"]= [/span][span style=\\\"color:#DD0000\\\"]\\\"SELECT * FROM lbryperm WHERE TEK_PART_NUMBER LIKE \'$PartNo\' AND ROHS_PROCESS >= \'\\\" [/span][span style=\\\"color:#007700\\\"]. [/span][span style=\\\"color:#0000BB\\\"]date[/span][span style=\\\"color:#007700\\\"]([/span][span style=\\\"color:#DD0000\\\"]\'Y-m-d\'[/span][span style=\\\"color:#007700\\\"]) . [/span][span style=\\\"color:#DD0000\\\"]\\\"\'\\\"[/span][span style=\\\"color:#007700\\\"]; [/span][span style=\\\"color:#0000BB\\\"]?>[/span] [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] this fills in the SQL format of the DATE field with todays date. 300135[/snapback] Quote Link to comment Share on other sites More sharing options...
AV1611 Posted September 27, 2005 Author Share Posted September 27, 2005 Wouldn't that always return TRUE because you are comparing to todays date, not the date in the record? I was thinking the answer would be: [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--] [span style=\\\"color:#0000BB\\\"]<?php $Date[/span][span style=\\\"color:#007700\\\"]=[/span][span style=\\\"color:#0000BB\\\"]$_POST[/span][span style=\\\"color:#007700\\\"][[/span][span style=\\\"color:#DD0000\\\"]\'DATE\'[/span][span style=\\\"color:#007700\\\"]]; [/span][span style=\\\"color:#0000BB\\\"]$sql [/span][span style=\\\"color:#007700\\\"]= [/span][span style=\\\"color:#DD0000\\\"]\\\"SELECT * FROM lbryperm WHERE TEK_PART_NUMBER LIKE \'$PartNo\' AND ROHS_PROCESS >= \'$DATE\'; ?>[/span] [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] Would that be right? 300163[/snapback] Quote Link to comment Share on other sites More sharing options...
obsidian Posted September 27, 2005 Share Posted September 27, 2005 Would that be right? 300163[/snapback] yes, i was just doing that for example... sorry, i should have stuck with what you requested ;-) good luck Quote Link to comment Share on other sites More sharing options...
AV1611 Posted September 27, 2005 Author Share Posted September 27, 2005 Sorry, I have a habbit of answering my own question after I post them... I guess it's easier to see on the forum than in my text editor LOL yes, i was just doing that for example... sorry, i should have stuck with what you requested ;-) good luck 300168[/snapback] Quote Link to comment 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.