Jump to content


Photo

simple question...


  • Please log in to reply
7 replies to this topic

#1 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 27 September 2005 - 06:52 PM

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

#2 neylitalo

neylitalo
  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 27 September 2005 - 06:58 PM

I need to change this to ROHS_PROCESS on or after a date...


Please clarify... I'm confused.
http://nealylitalo.net - My personal website, and home of The Netizen's Journal.

#3 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 27 September 2005 - 07:28 PM

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.

View Post





#4 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 27 September 2005 - 07:35 PM

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

View Post


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.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#5 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 27 September 2005 - 08:32 PM

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.

View Post



#6 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 27 September 2005 - 08:34 PM

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?

View Post



#7 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 27 September 2005 - 08:38 PM

Would that be right?

View Post


yes, i was just doing that for example... sorry, i should have stuck with what you requested ;-)

good luck
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#8 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 27 September 2005 - 08:42 PM

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

View Post






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users