displaying data for current week

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I track performance data on a daily basis. I would like to display - for
statistical purposes in a nested subform - accumulated stats for the current
week and the current month. I know I can do this if I query for dates that
are entered, but I would like to do this without user input on the dates.

In short - how do I display totals for the current week and the current
month in a child linked subform?

Thanks in advance!

Jeff
 
In the query criteria you can use:

Current month:

Select * From TableName Where Month(Date())=Month([DateFieldNAme])


Current week:

Select * From TableName Where Format(Date(),"ww")=Format([DateFieldNAme],"ww")

The format will return the week number
 
Thanks for the reply and help. I tried to follow the example you gave me but
I get a syntax error wanting me to ...

"Check the subquery's syntax and enclose the subquery in parentheses."

This is the expression I am trying to incorporate in the query criteria.

"Select * from Dial/Reg (OTM) where month(date())=month([Dial/Reg
(OTM)].[Date])"

The table is named exactly - Dial/Reg (OTM) - and I hope that my extremely
earlier use of parentheses in the table name isn't creating the hiccup. Can
you see where I am going astray?

Jeff

Ofer Cohen said:
In the query criteria you can use:

Current month:

Select * From TableName Where Month(Date())=Month([DateFieldNAme])


Current week:

Select * From TableName Where Format(Date(),"ww")=Format([DateFieldNAme],"ww")

The format will return the week number

--
Good Luck
BS"D


Jeff @ CI said:
I track performance data on a daily basis. I would like to display - for
statistical purposes in a nested subform - accumulated stats for the current
week and the current month. I know I can do this if I query for dates that
are entered, but I would like to do this without user input on the dates.

In short - how do I display totals for the current week and the current
month in a child linked subform?

Thanks in advance!

Jeff
 
When a Table of field names contain more then one word you need to put it in
square brackets

Select * from [Dial/Reg (OTM)] where month(date())=month([Dial/Reg
(OTM)].[Date])

--
Good Luck
BS"D


Jeff @ CI said:
Thanks for the reply and help. I tried to follow the example you gave me but
I get a syntax error wanting me to ...

"Check the subquery's syntax and enclose the subquery in parentheses."

This is the expression I am trying to incorporate in the query criteria.

"Select * from Dial/Reg (OTM) where month(date())=month([Dial/Reg
(OTM)].[Date])"

The table is named exactly - Dial/Reg (OTM) - and I hope that my extremely
earlier use of parentheses in the table name isn't creating the hiccup. Can
you see where I am going astray?

Jeff

Ofer Cohen said:
In the query criteria you can use:

Current month:

Select * From TableName Where Month(Date())=Month([DateFieldNAme])


Current week:

Select * From TableName Where Format(Date(),"ww")=Format([DateFieldNAme],"ww")

The format will return the week number

--
Good Luck
BS"D


Jeff @ CI said:
I track performance data on a daily basis. I would like to display - for
statistical purposes in a nested subform - accumulated stats for the current
week and the current month. I know I can do this if I query for dates that
are entered, but I would like to do this without user input on the dates.

In short - how do I display totals for the current week and the current
month in a child linked subform?

Thanks in advance!

Jeff
 
Thanks again for the quick reply. I wasn't able to make your solution work
in my query. I did some looking from last night and again today and what I
did get to work was the following:

Year([Date])=Year(Now()) And Month([Date])=Month(Now())

From here I should be able to generate my stats displays.

Sincerely, thanks for the help you offered.

Jeff

Ofer Cohen said:
When a Table of field names contain more then one word you need to put it in
square brackets

Select * from [Dial/Reg (OTM)] where month(date())=month([Dial/Reg
(OTM)].[Date])

--
Good Luck
BS"D


Jeff @ CI said:
Thanks for the reply and help. I tried to follow the example you gave me but
I get a syntax error wanting me to ...

"Check the subquery's syntax and enclose the subquery in parentheses."

This is the expression I am trying to incorporate in the query criteria.

"Select * from Dial/Reg (OTM) where month(date())=month([Dial/Reg
(OTM)].[Date])"

The table is named exactly - Dial/Reg (OTM) - and I hope that my extremely
earlier use of parentheses in the table name isn't creating the hiccup. Can
you see where I am going astray?

Jeff

Ofer Cohen said:
In the query criteria you can use:

Current month:

Select * From TableName Where Month(Date())=Month([DateFieldNAme])


Current week:

Select * From TableName Where Format(Date(),"ww")=Format([DateFieldNAme],"ww")

The format will return the week number

--
Good Luck
BS"D


:

I track performance data on a daily basis. I would like to display - for
statistical purposes in a nested subform - accumulated stats for the current
week and the current month. I know I can do this if I query for dates that
are entered, but I would like to do this without user input on the dates.

In short - how do I display totals for the current week and the current
month in a child linked subform?

Thanks in advance!

Jeff
 

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

Back
Top