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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|