On Mon, Jul 29, 2002 at 01:03:55AM -0700, Thomas Edison Jr. wrote:
>
> SELECT * FROM transactions,holdings where
> transactions.isinno=holdings.isinno AND
> transactions.clientid='$clientid' AND
> holdings.clbal!=0 GROUP BY holdings.isinno ORDER BY
> shares
>
> Now for this purpose i'm facing a simple problem. The
> Data being picked up is of the same date from both the
> Tables. However, what is required is that the Data
> from the "Holdings" table needs to be picked up from a
> Date a day earlier then the Transactions Table Data.
You don't have any JOIN's in there. Set up your JOIN syntax something
like this:
...FROM transactions
LEFT JOIN holdings
ON (transactions.date = date_sub(holdings.date, INTERVAL 1 DAY))...
This probably isn't exactly what you need because I'm not really paying
attention to the exact demands your request. Rather, I'm pointing you in
the right direction for you to figure out what you need to do by reading
the manual, hacking and searching newsgroup archives.
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php