RE: stock quantity problem

RE: stock quantity problem

 

  

What Bijoy is doing is truncating the 'time' portion of the date field
which will make it equal to midnight on the day in question. SYSDATE
has the date and the time, and that will be used in a date field.

-----Original Message-----
From: Bhat Vikas
[mailto:oracledba-ezmlmshield-x69185941.[Email address protected]
Sent: Tuesday, August 30, 2005 8:50 AM
To: LazyDBA Discussion
Subject: RE: stock quantity problem

Hi Bijoy,

Assuming you have 3 columns, itm, function, upd_date, the query to
achieve what you want is -

SELECT MIN(trunc(upd_date))
FROM <<table_name>>
WHERE trunc(upd_date) BETWEEN trunc(<<input_Date>>) AND trunc(SYSDATE)
GROUP BY itm, function

Warm regards,
Vikas Bhat
Senior Software Engineer,
FBSI Pvt Ltd.,
Embassy Golf Links Business Park,
Intermediate Ring Road,
Bangalore - 560071
Email - vikas.[Email address protected]
Ph:91-80-56916482
Mob:91-9845589149
Those who aspire for the light of sun; need to bear its heat.

Any comments or statements made in this email are not necessarily those
of Fidelity Business Services India Pvt. Ltd. or any of the Fidelity
Investments group companies. The information transmitted is intended
only for the person or entity to which it is addressed and may contain
confidential and/or privileged material. If you have received this in
error, please contact the sender and delete the material from any
computer. All e-mails sent from or to Fidelity Business Services India
Pvt. Ltd. may be subject to our monitoring procedures.



-----Original Message-----
From: Bijoy V
[mailto:oracledba-ezmlmshield-x78203758.[Email address protected]
Sent: Tuesday, August 30, 2005 6:09 PM
To: LazyDBA Discussion
Subject: stock quantity problem


Hello DBAs,

Some days back I have asked a solution for tracking stock
position, since I don't see a reply, let me ask once more.

The condition is, there exist a stock table that contains stock
quantity, that's used as current stock, but we need the stock position
of a specified date, for this I've created a trigger to log the existing
quantity to another table with SYSDATE when an update occurs to stock
table.

The problem is I have to take the MIN(Dates) from the
<specified
date> to current date for each item to function.

Please advice me for improvements.



Warm regards

Bijoy V







--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html



Oracle LazyDBA home page