[Hbasic-userinfo] DB select
Status: Beta
Brought to you by:
mengels
From: Dan K. <ko...@sb...> - 2004-05-01 17:37:59
|
I like what I see in HBasic. My problem is I have a very complex manufacturing system for the wine industry. It requires very complex SQL select and subselect statements. I'm not sure from your documentation how you do this. For example how would I find the last wine movement for a particular storage tank that falls between two dates. Is this possible? Do I need to make a View? Here is how I do it in PHP? Can I do this in HBasic. If so.. I'm sold. SELECT * FROM wine_process_order as WPO, wine_movement as WMOVE, storage as STORE WHERE WPO.wpo_date BETWEEN $FromDate AND $ThruDate AND WMOVE.storage_id = STORE.storage_id AND WMOVE.wpo_mum = WPO.wpo_mum AND WMOVE.mov_qty > 1000 AND WPO.type = 'C' !CRUSH ONLY AND (WPO.wpo_date = (SELECT MAX(LWPO) FROM wine_process_order as LWPO, wine_movement as LMOVE WHERE LWPO.wpo_num = WPO.wpo_num AND LWPO.wpo_mum = LMOVE.wpo_num AND LWPO.storage_id = STORE.storage_id AND LWPO.wpo_date <= $ThruDate)) Thanks for your time and help. Have a great day... Dan Kokenge. |