Jump to content

simple question...


AV1611

Recommended Posts

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]

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/2573-simple-question/#findComment-8544
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/2573-simple-question/#findComment-8545
Share on other sites

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]

 

Link to comment
https://forums.phpfreaks.com/topic/2573-simple-question/#findComment-8547
Share on other sites

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]

Link to comment
https://forums.phpfreaks.com/topic/2573-simple-question/#findComment-8548
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.