TPoly
asked on
"between" sql query
mysql> select qin, qout, yield, reject FROM yield WHERE date BETWEEN '11/01/2003' AND '01/31/2004';
hi...
i have this sql statement that does not extract the query i want
It did not even extract anything
this is how the table look like
+-----------+------------+ ------+--- ---+------ +-------+- -------+-- ------+--- ---------- --------+
| job | date | lot | qin | qout | yield | reject | report | dir |
+-----------+------------+ ------+--- ---+------ +-------+- -------+-- ------+--- ---------- --------+
| HDMP-0440 | 01/31/2004 | 321 | 15 | 15 | 100 | 0 | yield | /home/student |
| HDMP-0440 | 11/31/2003 | 456 | 15 | 15 | 100 | 0 | yield | /home/student/htm |
so how do i change this sql query?
hi...
i have this sql statement that does not extract the query i want
It did not even extract anything
this is how the table look like
+-----------+------------+
| job | date | lot | qin | qout | yield | reject | report | dir |
+-----------+------------+
| HDMP-0440 | 01/31/2004 | 321 | 15 | 15 | 100 | 0 | yield | /home/student |
| HDMP-0440 | 11/31/2003 | 456 | 15 | 15 | 100 | 0 | yield | /home/student/htm |
so how do i change this sql query?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As Roonaan already suggests this problem is mos likely caused by the date format that you use in your SQL. Even though the format you use in your SQL matches the one in the output of the SELECT it can still cause problems. It is best to use a format that leaves no room for wrong interpretation. The format Roonaan suggests could work, but on the MySQL site they tend to favour a format without any separators in there, like "20040131".
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oops.. frank van puffelen has already suggested the same. Disregard my post.
:) SD
:) SD