Access 97 query to show previous 7 days data

G

Guest

I am trying to create a query that will show data for the the previous 7
days, but not the current day.
 
M

[MVP] S.Clark

Select * from tablename where [somedatefield] between (date - 8) and
(date -1)
 
G

Guest

You could probably tell from my question that I am new to this. With that said;
I entered the following in the criteria:

Select* from [dbo_BREW_DAYAVG] where [timestamp] between (date - 8) and
(date -1)

I get a syntax error message.

I am amazed that after a week of classes on Access I have lost so much of
what I was taught. Very ego deflating.

[MVP] S.Clark said:
Select * from tablename where [somedatefield] between (date - 8) and
(date -1)


--
Steve Clark, Access MVP
FMS, Inc.
www.fmsinc.com/consulting

Dan Kelly said:
I am trying to create a query that will show data for the the previous 7
days, but not the current day.
 
G

Guest

OK, here is what I put in:
Select* from [dbo_BREW_DAYAVG] where [timestamp] between (date - 8) and
(date -1)

it returned a syntax error. Can you tell I'm new to this ;-)

After a week of classes, I would have thought I would retain more of what I
was taught. Very ego deflating...

[MVP] S.Clark said:
Select * from tablename where [somedatefield] between (date - 8) and
(date -1)


--
Steve Clark, Access MVP
FMS, Inc.
www.fmsinc.com/consulting

Dan Kelly said:
I am trying to create a query that will show data for the the previous 7
days, but not the current day.
 
G

Guest

Ok, I tried the following but got a syntax error:

Select* from [dbo_BREW_DAYAVG] where [timestamp] between (date - 8) and
(date -1)

I'm sure you can tell I am new to this. Thanks for your help.

[MVP] S.Clark said:
Select * from tablename where [somedatefield] between (date - 8) and
(date -1)


--
Steve Clark, Access MVP
FMS, Inc.
www.fmsinc.com/consulting

Dan Kelly said:
I am trying to create a query that will show data for the the previous 7
days, but not the current day.
 
G

Guest

Well isn't this embarassing. I kept getting errors when replying, now I see
that they were in fact posted.
 
R

Rick Brandt

Dan Kelly said:
Ok, I tried the following but got a syntax error:

Select* from [dbo_BREW_DAYAVG] where [timestamp] between (date - 8) and
(date -1)

I'm sure you can tell I am new to this. Thanks for your help.

No space between "Select" and "*".
 

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