By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,484 Members | 1,811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,484 IT Pros & Developers. It's quick & easy.

Sum Query

P: n/a
Dears,

I have a table with four main fields (item, price, in_date, out_date),
where in_date and out_date declares the time when the item came to
stock .................

now in a query, i want to find the sum(price) of items that came in
and the sum(price) of items that went out, I just want to include the
item in the sum where in or out field is filled by a date in two
fields (sumofins and somofouts).

I appreciae any help from your side,

regards,
Naweed

Jul 22 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Baz
Query1:

SELECT Sum(price) AS sumofins FROM sometable WHERE in_date IS NOT NULL

Query2:

SELECT Sum(price) AS sumofouts FROM sometable WHERE out_date IS NOT NULL

Query3:

SELECT sumofins, sumofouts FROM Query1, Query2

"User" <ka*******@gmail.comwrote in message
news:11*********************@r34g2000hsd.googlegro ups.com...
Dears,

I have a table with four main fields (item, price, in_date, out_date),
where in_date and out_date declares the time when the item came to
stock .................

now in a query, i want to find the sum(price) of items that came in
and the sum(price) of items that went out, I just want to include the
item in the sum where in or out field is filled by a date in two
fields (sumofins and somofouts).

I appreciae any help from your side,

regards,
Naweed

Jul 22 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.