Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Date query

Posted 06 Feb 2006 19:02:14
1
has voted
06 Feb 2006 19:02:14 Javier Castro posted:
Hi,
I created an ordering system were users input orders on a form and they are displayed below as they place their orders. I want to process those orders weekly, so, every week when the users go to order again they don't continue seeing the orders of the week before.
Which is what it is happening now. Since my query displays orders for the last 7 days. but
I want to be able to query records from Mondays to Sundays at 5pm. and so on every week.

How could I achieve this ???

Thanks,

Javier


Replies

Replied 07 Feb 2006 18:48:57
07 Feb 2006 18:48:57 Derek McLean replied:
Here's one I used - This is taking 6 drop down menus (3 for start date, day month, year, 3 for end date, day month year) - It then joins (or concatenates) the three into a MySQL formatted date, and, as it is a timestamp, you can change the times as 9:00 - 5:30 or whatever it is you need

WHERE `date` BETWEEN TIMESTAMP(CONCAT(yearparam,'-',monthparam,'-',dayparam,' 00:00:00')) AND TIMESTAMP(CONCAT(yearparam2,'-',monthparam2,'-',dayparam2,' 23:59:59'))
ORDER BY suppname ASC


Check out the mysql website, there are certified geniuses on that site 24-7 <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replied 10 Feb 2006 07:16:38
10 Feb 2006 07:16:38 Javier Castro replied:
Thanks Derek, I had to stop for few days but I'm back and I will play with your idea. Thanks.

Javier

Reply to this topic