Filtering A Calculated Field

Aug 23, 2007

Hi

I've had a search through the forum but can't find anything to solve my issue. Hope someone can help with this one.

I want to filter a query (ultimately a report) based on date parameters entered by the user (start date & end date) on a form. I've done this plenty of times before with no problems. However, this time it's returning incorrect information - stuff that doesn't fall witin the date parameters of the filter.

I've checked other databases I've built and everything looks the same. The only thing I can think of is that I'm asking the query to filter a calculated field rather than a field with information entered by the user. Is this what might be causing the problem?

The field that the filter looks at is a calculated field that calculates a date 6 weeks before another date entered by the user.

Hope I've provided enough info for someone to think they know what's wrong!

Cheers, as always.

View Replies


ADVERTISEMENT

Basing A Calculated Field On Another Calculated Field

Apr 12, 2006

My query contains two calculated fields [TaxSavings1] and [TaxSavings2], which are based on some currency and number-type fields in one of my underlying tables.

I just created another field in my query which looks like: [TaxSavings1]+[TaxSavings2]. Instead of adding the two fields, it actually lumps the two numbers together. For example, if [TaxSavings1] =135 and [TaxSavings2]=30.25, it will give me: 13530.25. I need it just to simply add, i.e. answer of 165.25.

Does anyone know how to correct this? Thanks in advance.

:confused:

View 1 Replies View Related

Tables :: How To Make Calculated Field Based On Field In Another Table

Jun 18, 2014

Table1 contain Two fields (3Months) and (6Months)

Table2 contain Two fields (3Months) and (6Months)

the table 2 is the source of a form that will let the user change the numbers. table 1 should change Date1 and Date2 Fields based on the two fields (3months) and (6months) if i want to make a lookup wizard it should be changed manually and if i make a calculated field i can't find other tables in the expression builder

View 1 Replies View Related

Queries :: Calculated Field To Display Value Of One Field Based On Another

Jul 23, 2015

I have a query with a Date field for EndDate (the dates for end-of-week, Fridays in our case) and another field for Sales (number of sales, not dollars).I want to add 4 calculated fields that represent weeks and have the Sales appear in the correct column (field) for that date.So I will have columns for 10 July 15, 17 July 15, 24 July 15 and 31 July 15 and I want the Sales for each record to land in the correct date column, based on the EndDate column. (The 4 fields is just for the sake of the example, I will actually be having dozens of these calculated date fields).I tried to do it by setting up the 4 calculated fields like:

10Jul15: Sales
and then adding Criteria like:
EndDate = #10/07/2015#
It doesnt work.

View 3 Replies View Related

Tables :: Calculated Field Error - Cannot Define Field More Than Once

Jun 10, 2015

I use access 2010.

I am assuming by the error code, one can not use a calculated field to calculate another field.

View 1 Replies View Related

Filtering Out Part Of A Field

Apr 7, 2008

Hi,

Apologies, I have no idea if this should go in reports, queries, macros or modules and VBA as I'm a bit stuck but hopefully it's fairly simple.

I've been teaching myself access and it's been going well. What I have now been asked to do is produce a report that generates the shift patterns for everyone in the office as an HTML document. Now, the data is all exported from another program and I've had no problem getting the data into access easily. The problem I have is the format some of the data is in.

The major one that I need to solve is showing what time people are meant to take their lunch break each day. The field for break is filled in in the following format.

07/04/2008 12:45:00

Now, I have the date from elsewhere so I really don't want the date to show up so I need something that removes the date from this field. Is this going to be easy to do? (Ideally I'd like it so that the above example actually just returned 12:45 but if it has the 00 on the end that would not be the end of the world)

Apologies if this is in the wrong part of your forum.

View 3 Replies View Related

Partial Field Filtering

Dec 15, 2006

Is there a way to filter based on a partial field match. I couldn't find anything posted before, but it doesn't seem like an unusual problem. I have an inventory database and have a field for part number. I would like to create a filter that would display only part numbers that begin with "FNQ" for example. The entire part number would include other numbers and letters, of course. How can I do this?:confused:

View 2 Replies View Related

Filtering A Dropdown Selection Data Field?

Mar 1, 2005

I'm trying to filter my table so that i can make it a query. The data in the Facility is linked to another table with FacName and FacID. When i try to filter the data to create the query from the table, it says type mismatch. It's really bothersome....btw is there another way to create a filtered query?

View 2 Replies View Related

Forms :: Filtering Out Based On A Filled Field?

Jul 7, 2015

I have a form that I want to filter out certain records based on if a field has data in it or not. I tried using a macro and putting the field equals "IsNotNull", but that didn't work. I just asked me what "IsNotNull" is suppose to be. correct way to do this via macro?

I tried searching but was finding VBA with other filters being applied (which is not the case).

View 3 Replies View Related

Queries :: Filtering On Value Of Formatted Date Field

Feb 22, 2014

I have a database with a table of employees, and that has a column named "DaysOff", into which I type a couple of days like this: "SUNDAY AND MONDAY"

Next, I have a form onto which I will display a query of those employees. The form contains a field called DATE in which I display the mm/dd/yyyy date. What I want to do is this:

I only want those employees that have a DaysOff field that DOES NOT CONTAIN the WEEKDAY NAME of the date in the DATE field. So, for instance, if the DATE field read 2/22/2014, and I have three employees as such:

Employee 1 DaysOff "Monday and Tuesday"
Employee 2 DaysOff "Friday and Saturday"
Employee 3 DaysOff "Sunday and Monday"

In that case, ONLY EMPLOYEES 1 and 3 should show up. Employee 2 will NOT show up, because his DaysOff field contains the word "Saturday", and the WEEKDAY FORMATTED value of the DATE field is "Saturday"

I hope that's not too confusing. Again, this needs to be the filter criteria for the query. That query will only return a list of employees that are NOT off on the day in question. If one of their off days is the day in question, the query won't return that record.

I've tried a few things, but I can't get it to work. If you want, I can list the various things I've tried, but I imagine one of you knows exactly how to do what I need to do, and you won't need my feeble attempts as a springboard.

View 2 Replies View Related

Modules & VBA :: Filtering Same Field Twice With 2 Combo Boxes?

Feb 4, 2014

I have a sub form that I enter date range in 2 text box's txtstartdate and txtenddate this is filtering field "date raised" and I have combo box call cboclient this is filtering field "client name" this code is behind a command button after hitting the command button it open's the report and it show's all records with in the date range and with client name enter in cboclient works great. problem is I have now added another cboclient2 to filter client name twice so now I enter a date range in txtstartdate and txtenddate put a client name in cboclient and a client name in cbocleint2 hit command button it open's the report but doesn't apply the date range to cboclient2 it just show's all records with that client name

Code:
Private Sub cmdPreview_Click()
'On Error GoTo Err_Handler 'Remove the single quote from start of this line once you have it
Dim strReport As String
Dim strDateField As String
Dim strWhere As String
Dim lngView As Long

[code]...

View 14 Replies View Related

Forms :: Filtering Data Field On Main Form?

Jan 22, 2014

Is it possible to use Filter option in my form without using Query Wizard? - So that the user would be able to edit and change the other field on the same form

View 2 Replies View Related

Calculated Field

Feb 9, 2006

Hi,
I have a calculated field in a query that concatinates an order number prefix and the part number to give the order number:
OrderNum: [OrderPrefix] & [PartNum]

There are 2 tables:
tblPartsList
PartNum
PartDesc

tblPartsListCategories
OrderPrefix
OrderNumCategory

This works fine except for one of the categories. For the third category there are no entries in the tblPartsList - because they are miscellaneous.

How do I change the calculation so that it works as above where there are corresponding Part numbers in tblPartsList and otherwise gives me the order number and any 2 digits e.g. something like [OrderPrefix]*

Having been trying to do this for ages but having trouble with syntax.

View 10 Replies View Related

Calculated Field

Apr 20, 2006

hi. i wanted to kno how to have a field in a table that is calculated from other fields if this is possible. for example i have a order table which has a quantity field and a price field and i want to add a total field that will alutomatically calculate the total (quantity*price) and add it to the field. i know how to do this in a query but don know how to get that field from the query into the table. thanks for any help

View 2 Replies View Related

Calculated Field

Aug 11, 2005

I am new to Access so please be gentle.

I heve started a new table and one of the fields is Date of Birth.

I want to have another field that looks at the data in DOB and calculate the age, I believe that this can be done with funtion datediff, but the layout doesnt look for other fields, it just looks for a date and the Now statement.

Any ideas on how to make this work? does it have to be a querie?

Mant Thanks

View 3 Replies View Related

Calculated Field

Aug 11, 2005

I am new to Access so please be gentle.

I heve started a new table and one of the fields is Date of Birth.

I want to have another field that looks at the data in DOB and calculate the age, I believe that this can be done with funtion datediff, but the layout doesnt look for other fields, it just looks for a date and the Now statement.

Any ideas on how to make this work? does it have to be a querie?

Many Thanks

View 1 Replies View Related

Calculated Field

Aug 11, 2005

I am new to Access so please be gentle.

I heve started a new table and one of the fields is Date of Birth.

I want to have another field that looks at the data in DOB and calculate the age, I believe that this can be done with funtion datediff, but the layout doesnt look for other fields, it just looks for a date and the Now statement.

Any ideas on how to make this work? does it have to be a querie?

Many Thanks

View 12 Replies View Related

Calculated Field

Apr 2, 2006

I have a table with customers, one with products and one transaction table. How can i produce a report, based on a query that will add up the total any one particular customer has spent to date from the transaction table?

View 1 Replies View Related

Calculated Field

Apr 20, 2006

hi. i wanted to kno how to have a field in a table that is calculated from other fields if this is possible. for example i have a order table which has a quantity field and a price field and i want to add a total field that will alutomatically calculate the total (quantity*price) and add it to the field. i know how to do this in a query but don know how to get that field from the query into the table. thanks for any help

View 1 Replies View Related

Calculated Field

Oct 26, 2006

i have opened a field (which was created in a table) in a form as a calculated fieled
the calculations are ok but only in the for
the same field in the table remainded empty

how can it be set so the table's field will get the clcaulation ?

** here is a sample file

View 2 Replies View Related

Calculated Field

Oct 15, 2007

I have this query which selects two fields and calculates it in another field.
But the calculated field has more than 1 expression.Eg
If field A < Field B,Field B + Field C AS X,If field A < Field C,Field A + Field C AS Y.The problem is that when I show this on the Form I want only 1 of the fields to be shown ie either X or Y .if any of the expressions is satisfied then only that field should be shown as a textbox control on the form and not both.How do I do this?? Its really complicated for me..Pls help..

View 14 Replies View Related

A Little Help With A Calculated Field

Dec 5, 2006

Hello,
Can someone please help with this expression?

I have a table with text field Cust_ID and a
Number field MCounter.

I would like to put in an expression as source in a form
Text field based on the same table to AGGREGATE
all MCounter values for a Given Cust_ID

Something like
Sum(MCounter) where "Cust_ID"=[Cust_ID]

Is this a correct expression?

Many thanks for any help.

View 3 Replies View Related

Calculated Field

Feb 22, 2007

This seems a daft question but I have searched the forums and can't find an answer so I hope someone can help me.

I have a table: Register(RegID, Pupil, Activity, Duration, Preparation)

I have a query that I want to calculate the total hours the pupil has spent on activities.

The Duration and Preparation fileds are held as number of minutes so for a 1 hour event the number 60 is held.

I have a query with 4 fields:
Pupil
SumofDuration
SumofPreparation
TotalHours = ([SumofDuration]+[SumofPreparation])60

The problem I have is that TotalHours is calculating as an whole number.
e.g. I have a Record
Pupil = 701
SumofDuration = 270
SumofPreparation = 0
TotalHours = 4

But I want TotalHours = 4.5

I have set the Duration and Preparation field sizes to Decimal and Format to General Number.

I don't know what else to try.

View 4 Replies View Related

IIf Calculated Field

Mar 10, 2005

Can anyone tell me why this won't work? It calculates the 2nd argument (reduction_man) but not the first (reduction)

I have tried both of these and still can't get it to work.


=IIf([reduction])>0,([reduction]*[2004volume])/(13-[cutinmonthnmbr]),([reduction_man]*[2004volume])/(13-[cutinmonthnmbr]))


=IIf(IsNull([reduction])=False,([reduction]*[2004volume])/(13-[cutinmonthnmbr]),([reduction_man]*[2004volume])/(13-[cutinmonthnmbr]))

Thanks!

View 1 Replies View Related

Calculated Field

May 24, 2006

Hello Guys,

I am trying to do the following in a form.
1) (Travel hours + work hours) * dollarperhr to get the "Total" bill to a customer.

2) The results will be put in a field "TotalDollars" that is a part of a table.

Please help.

I tried to put an event (on change) on the "dollarperhr" box so that after entering the values in "travel hours" + "Work hours" * "dollarperhr", the calculation will be done to populate "TotalDollars", but it didn't work.

please help

View 7 Replies View Related

Calculated Field

Dec 21, 2004

Hi here is my problem

I have a table named= Commun tasks
which has 3 fields= [Commun tasks],[Quantity] and [Unit Cost]

I created from that table a form who shows these 3 fields. I also created in that form a calculated field (named Total) who shows the Total. I simply wrote
in the control source =[Unit Cost]*[Quantity]

I have another table (Project Information) who has 3 fields=[Prior total],[New Total],[cost addition]

What I need to do is each time the [Quantity] or the [Unit Cost] are changed, I need to show the [New total]. But also i need to show the [Prior total] which is based on the [Quantity] and [Unit Cost] before the change. So i think i need to store the calculated field (Total) in a table, but I don't really know how to do that (I,m a newbie).

Ok let's simplify my question

How can I store in a table a value from a Calculated field? I know that we should not store calculated value but in my case I need to store them.

Thanks for help

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved