A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Select only even or odd number records



 
 
Thread Tools Display Modes
  #1  
Old March 29th, 2010, 02:45 AM posted to microsoft.public.access.reports
Phillip
external usenet poster
 
Posts: 63
Default Select only even or odd number records

Hi,
I have a table with among other things has on number field. I want two
reports, one that select only records with even number in the number field
and the second report that selects only records with odd numbers in the
number field.
I'm on the query builder screen and can't figure out the correct code to
place in the criteria section for each report.
Your help would be appreciated.
Thanks in advance.
  #2  
Old March 29th, 2010, 03:14 AM posted to microsoft.public.access.reports
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Select only even or odd number records

You can take you unnamed number field and use /2 or the Mod operator to
create a column in the query/record source:
OddEven: [UnnamedNumericField] Mod 2

In the criteria, enter 1 for odd records or 2 for even.

--
Duane Hookom
MS Access MVP


"Phillip" wrote in message
...
Hi,
I have a table with among other things has on number field. I want two
reports, one that select only records with even number in the number field
and the second report that selects only records with odd numbers in the
number field.
I'm on the query builder screen and can't figure out the correct code to
place in the criteria section for each report.
Your help would be appreciated.
Thanks in advance.


  #3  
Old March 29th, 2010, 04:37 AM posted to microsoft.public.access.reports
Phillip
external usenet poster
 
Posts: 63
Default Select only even or odd number records

Hi Duane,
Thanks for your response, but I'm not sure how to do what you said. I can't
place an expression in the criteria section of my number field in the query
builder screen?
Thanks,
Phil

"Duane Hookom" wrote:

You can take you unnamed number field and use /2 or the Mod operator to
create a column in the query/record source:
OddEven: [UnnamedNumericField] Mod 2

In the criteria, enter 1 for odd records or 2 for even.

--
Duane Hookom
MS Access MVP


"Phillip" wrote in message
...
Hi,
I have a table with among other things has on number field. I want two
reports, one that select only records with even number in the number field
and the second report that selects only records with odd numbers in the
number field.
I'm on the query builder screen and can't figure out the correct code to
place in the criteria section for each report.
Your help would be appreciated.
Thanks in advance.


  #4  
Old March 29th, 2010, 04:59 AM posted to microsoft.public.access.reports
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Select only even or odd number records

Did you try create the OddEven field in your query and then look at the
results in datasheet view? You should see 0s and 1s. There are lots of
solutions for filtering a report based on a field value in the query.

--
Duane Hookom
MS Access MVP


"Phillip" wrote in message
...
Hi Duane,
Thanks for your response, but I'm not sure how to do what you said. I
can't
place an expression in the criteria section of my number field in the
query
builder screen?
Thanks,
Phil

"Duane Hookom" wrote:

You can take you unnamed number field and use /2 or the Mod operator to
create a column in the query/record source:
OddEven: [UnnamedNumericField] Mod 2

In the criteria, enter 1 for odd records or 2 for even.

--
Duane Hookom
MS Access MVP


"Phillip" wrote in message
...
Hi,
I have a table with among other things has on number field. I want two
reports, one that select only records with even number in the number
field
and the second report that selects only records with odd numbers in the
number field.
I'm on the query builder screen and can't figure out the correct code
to
place in the criteria section for each report.
Your help would be appreciated.
Thanks in advance.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:27 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.