Retrieve Cumulative infor

G

Guest

I have a table that has a date field in in it. I would ike to create a query
that uses that date field and collects a total of all the rqsts upto that
date and not only that date e.g., if I have the following information in my
table

RqstID DateRcvd EmpID
0001 09/01/05 1
0002 09/01/05 1
0003 09/01/05 2
0004 09/02/05 2
0005 09/03/05 1
0006 09/04/05 1

So if I enter the date 09/02/05 I would like to get a total of 4 and not 1
 
C

Chaim

Not quite certain I understand what you mean by "upto that date and not only
that date".

If you mean that you want a count of the records that are present up to and
including a certain date, you should be able to use:
SELECT count(*) from [Your Table]
WHERE [DateRecvd] <= [Enter your date]
 
G

Guest

I think I'm misinderstanding your problem description. As I read it, your
query would produce 6 records, not 4. I'm assuming you mean to say all
records up to BUT NOT INCLUDING the date selected-- is this correct?

Randall Arnold
 
G

Guest

I hope you are counting the RqstIDs' and not adding up the EmpID, EmpID
stands for EmpID1 is John and EmpID2 is Jane
So if today is 09/26/05 i woulid like to know how many Rqsts were received
by 09/02/05 and that would be a total of 4, so that would mean upto and
including 09/02/05
 
G

Guest

Thanks alot, that worked perfect!

Chaim said:
Not quite certain I understand what you mean by "upto that date and not only
that date".

If you mean that you want a count of the records that are present up to and
including a certain date, you should be able to use:
SELECT count(*) from [Your Table]
WHERE [DateRecvd] <= [Enter your date]

--

Chaim


JOM said:
I have a table that has a date field in in it. I would ike to create a query
that uses that date field and collects a total of all the rqsts upto that
date and not only that date e.g., if I have the following information in my
table

RqstID DateRcvd EmpID
0001 09/01/05 1
0002 09/01/05 1
0003 09/01/05 2
0004 09/02/05 2
0005 09/03/05 1
0006 09/04/05 1

So if I enter the date 09/02/05 I would like to get a total of 4 and not 1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top