|
Posted by Tyrone Slothrop on 08/25/05 17:10
On Thu, 25 Aug 2005 11:17:32 GMT, "Brian" <not@given.com> wrote:
>Hi all
>
>I hope I can explain this properly.....
>
>I'm trying to run a search on a MySQL table that checks if item
>were out of stock between 2 dates and reports it
>
>This is what it need to do
>
>The fields are
>timestamp = the timestamp to search on
>status = the status code, 'o' if out of stock
>ord = the number ordered
>description = the item description
>
>I need to say show me items between startday and endday that were out of
>stock
>and how many were ordered
>
>e.g.
>
>Item A = 400 ordered
>Item B = 250 ordered
>Item C = 100 ordered
>
>What's the best way to do this without have vapours SQL queries?
>
>Any help would be great
>
>Brian
The query is fairly simple:
SELECT * FROM products WHERE (timestamp <= $enddate AND timestamp >=
startdate) AND status = 'o';
However, if you don't know how to structure the query, I have the
feeling you will have a number of other questions. ;-)
Navigation:
[Reply to this message]
|