Double Criteria On One Field Problem

May 27, 2005

Apologies, this was posted as a reply to a previous thread I submitted but its not related to the title anymore (dlookups).

I have a query that looks up a payrate value for an employee in a payrate table. It uses the appropriate value to determine the pay rate at teh time an employee has worked (DateWorked). On top of this I also need to introduce a parameter criteria on the DateWorked to allow the user to run the report for a time frame. This is where I get stuck as I cant seem to get it to work properly if I introduce another criteria on the field

The query that works great (without the second criteria) is as follows;

SELECT tblTimeCard.EmployeeId, tblTimeCard.TimeCardId, tblTimeCardHours.Task, tblTimeCardHours.Hours, tblTimeCard.DateWorked, tblPayRates.DateFrom, tblPayRates.DateTo, tblPayRates.PayRate,
tblTimeCardHours.Hours*tblPayRates.PayRate AS Cost
FROM (tblTimeCard INNER JOIN tblTimeCardHours ON tblTimeCard.TimeCardId = tblTimeCardHours.TimeCardId) INNER JOIN tblPayRates ON tblTimeCard.EmployeeId = tblPayRates.EmployeeId
WHERE tblTimeCard.DateWorked Between [tblPayRates].[DateFrom] And [tblPayRates].[DateTo];

This is where I need to introduce another criteria where tbl.TimeCard.DateWorked Between [Enter Date From] And[Enter Date To]

when I try this I must have one of the joins wrong as I get all the payrate values for each date worked even if they are outside the dateworked criteria set by the second criteria.. I hope I have explianed this ok. Can someone please advise where I should be looking - many thanks

View Replies


ADVERTISEMENT

General :: Deleting Record Based On Double Criteria

Nov 30, 2012

I am wanting to delete a record based on 2 criteria. ive had a look on the net and it looked so simple. I tried

PHP Code:

CurrentDb.Execute _    "DELETE FROM tblRecommendedProducts " & _    "WHERE ClientDetailsID = " & [Forms]![frmClientSale]![ClientDetailsID] And "WHERE ItemsID = " & [Forms]![frmClientSale-Retail]![ItemsID], dbFailOnError 

View 14 Replies View Related

Forms :: Preventing Double Booking Of Room In Form Based On Multiple Criteria

Aug 13, 2015

I have Table for rooms called Rooms, and the data in the table is roomNumber which is in the format Letter and two Digit number, so A01 would be dorm building A and room building 1, and I then have a seperate row named roomType that is either VIP or Semi Private.

Now I am creating a form where a worker will put in there scheduledCheckin date and scheduledCheckout date and it will be written to the Bookings table. I would like this form however to take the dates they have put in, as well as room type (Semi-Private or VIP, and assign them an available room that isn't booked at all in that range) or list all available rooms for that range of time and they could then just select the room. I would rather it automatically assigns an available room based on room type though because this check in system is going to have about 500 rooms.

I've attached a link for what I have so far. I know how to make a query to list anyone who has booked rooms over that date, but need one for just preventing booking the same room.

[URL] .....

View 3 Replies View Related

Update A Form Field By Double Clicking A Query Field

Apr 25, 2013

I have 3 peices of data that I am working with: Group number, plans and benefit elections. On my form I have fields for the group number and plan and 2 queries. When I enter a group number the first query displays a list of plan descriptions for that group. From there I can enter the plan description into the form's plan field and that runs the second query to give me a list of valid elections for that plan. This all works fine but I want to make the plan selection a little less tedious. What I would like is to be able to double click the query field housing the plan description and have it copied to the form's plan field. I could use the ID instead of the plan description but I work in a production environment and very key stroke counts so I would really like to have a simple double click process.

Is this even possible? If so how would I set that up? I tried using the double click on event macro builder but it does not seem to have this kind of option.

My form contains fields for group number and Plan. The same form houses 2 querys, one that pulls plans based on the group number and the other to pull elections based on the plan field (not the plan query). Would like to double click a plan within the plan query and have that description populated into the form's plan field.

View 6 Replies View Related

Button For Double Field

Nov 12, 2011

i make form and insert into some fields. how make button, that you add double fields under create fields??i have these fields:

field1 field2 field3 field4 // pres button for double fields

field1 field2 field3 field4
field1 field2 field3 field4

View 5 Replies View Related

Double Return Into A Memo Field

Nov 13, 2007

Is there any way in which I can automate a query (or update table query) to find the next date stamp that always starts with 'DATE', and put a double return in before it (so it starts on a new line with a spare line between). This is a table with 2 fields in it, the first being a Customer Reference number, and the second being a memo field, and some of the details and dates are quite vast. As an example the following text that is currently being displayed in the memo field would be displayed as the section below.

From this:-
DATE: 13/11/2007 TIME: 2:24 PM:went to pay with CC DATE: 09/10/2006 TIME: 3:41 PM:Sent Invoice to Scott DATE: 10/10/2005 TIME: 10:22 AM:Email follow up to obtain feedback DATE: 25/10/1999 TIME: 11:18 AM:Received all documentation

To this:-
DATE: 13/11/2007 TIME: 2:24 PM:went to pay with CC

DATE: 09/10/2006 TIME: 3:41 PM:Sent Invoice to Scott

DATE: 10/10/2005 TIME: 10:22 AM:Email follow up to obtain feedback

DATE: 25/10/1999 TIME: 11:18 AM:Received all documentation

View 9 Replies View Related

General :: Field Default Value In Double Quotes

Jul 22, 2012

On an existing DB i have set a default value for a field. The customer has now asked that they be able to change this default. I thought, hey, no big problem. They have SuperUsers, so i included a little pop up form that lists all the current valid values for that field (from a look up table). If the default value needs to change a superuser can access this and select the new default. That works fine. The trouble comes when setting the default value on a form.

I figured a simple bit of VBA in the OnOpen event - Me.cmbTypes.Value = Me.cmbTypes.DefaultValue - should work. However the value it returns from the default is ""xxxx"" and as such it is read as "". I can work around it by removing the extra " " but WHY does it do this? Would it be better to set this up as a custom property of the DB?

Using Access 2003

View 5 Replies View Related

Forms :: Double Click On A Field In A Form

Dec 22, 2013

I need created a form frmFlight this form has two fields called DEP and ARR what I need is when the users types the 3 letter code in the DEP or ARR field if these do not match the any records in field AirportCode in the table tblAirport will highlite a error. Also I need to double click on the field DEP or ARR in the frmFlight and open the frmAirport with the specific record. Example if one of the records contain LCY by double clicking it will open the form frmAirport displaying the LCY record.

View 8 Replies View Related

Double Input Mask For Data Field

Jun 30, 2014

Is it possible to set a double input mask for a field? I would to set it so users can eneter two different values for data field: 00/00/0000 or just the year 0000, is it possible? How do I do that?

View 1 Replies View Related

Tables :: Decimals Rounding Even With Double Field Size

Nov 8, 2012

For some reason I cannot enter decimal values without the number rounding up or down. I've already set it to 'Number' and 'double' and have also tried 'Fixed' set to 2 decimal places. Right now the only way it works is if I set it to 'Text'. However I need to do some calculations with these values eventually.

What's strange is I have another table in the same database that is NOT rounding and is working just fine.

View 3 Replies View Related

Tables :: Field Size Set To Double - 0.5 Is Input But Table Says 2

Dec 20, 2013

I have a form that utilizes a combo box with 2 options: 0 & 0.5. If I select 0.5 on the combo box the field in the table records it as 2. Why doesn't it reflect as 0.5? And how do I fix it?

This is the general info that I have for the field properties:

Field Size - Double
Decimal Places - 1
Default Value - 0

View 3 Replies View Related

Forms :: Format Double Field As Long Time

Feb 17, 2015

I have recently upgraded my Access 2003 application to Access 2010. I am running into a problem when formatting a textbox to 'Long Time' that is linked to a Double type field. The error that I get is 'The value you entered isn't valid for this field. You may have entered text in a numeric field or a number that is larger than the FieldSize setting permits.'

The textbox is linked to a field (double data type) and displays as the time in long format (4:06:17 PM). When I try to change to 4:07:17 PM I get the error. I tried removing the 'PM' and the colons but the error still occurs. The only way that I can get it to work is if I use a double value (0.735405092592593). In Access 2003 the time value would display properly, allow me to change the time and then save the time as a double to the database.

View 3 Replies View Related

How To Display Popup Text On Double Click Or Mouseover Of A Field

Nov 20, 2013

I know how to do an action on doubleclick or mouseover but I want some simple text to come up, possibly with a white background behind it that has some details about the specific production number that the user is clicking on. Is there something like this? I tried a dialog but it brings up an ugly form, I just want the text or something simple. Can this be done?

View 2 Replies View Related

Tables :: Autopopulation Of Field From Another Table Based On Another Field Criteria

Dec 5, 2012

I have a main table which is autonumbered on unitid, I have another table which is linked via the unitid which holds items purchased for the main table, so the second table is a subform of the suppliers and will have multiple entries of the same unitid. What I would like to do is when an item is entered into the second table, check the main table to see if it exists, if it does populate the unitid field with the unitid from the main table, and if not exist create a new record in the main table with the next unitid number.

This in essence is what I want, bearing in mind that the tblinvoices is a subform and the tblmain is not open.

If ([tblinvoices]![Unit] = [tblmain]![Unit]) Then
[tblinvoices]![UnitID] = [tblinvoices]![UnitID]
End If

View 3 Replies View Related

Queries :: Using New Field In Query As Criteria In Different Field?

May 11, 2013

I have a query where I prompt for a Report_Date to create a new field; Report_Date:[ Enter date for report]

Is it possible to use the result from this prompt as a criteria in a different field?

for example, Order_Date based on the criteria of <=[Report_Date]

View 4 Replies View Related

Queries :: Use Another Field With Between Criteria On Another Field

Sep 29, 2014

I have db that tracks vehicle mileage and servicing

I have created query to show which vehicles are due service by the mileage

My issue is some manufacturers set different service intervals

E.g.
car manufacture A = service intervals every 10,000
car manufacture B = service intervals every 20,000

but i would like to give pre warning so I'm using between criteria

here is what i have much appreciate if there is a better why of doing this

im using Dmax to find the last mileage entered for the vehicle

findLast: DMax("[vehicle mileage]","[vehserviceTbl]","([vehicleidimp]= " & [vehicleid] & ")")

now the criteria

Ifs([make] = "A" , Between 9000 and 10000
ifs ([Make] = "B" , between 19000 and 20000

can't get the red text to work shows blank when query runs

View 1 Replies View Related

One Field, Two Criteria!

Jun 1, 2005

Hi there
I have a table of which I need to count the instances of one of the fields.
The trouble is that I need to return two different counts based on two different criteria.

I don't really want to duplicate the table just to be able to achieve this, and I wanted to be able to construct it in a way that I can use in my ASP page which interrogates the database.

Of course everything I've tried applies the two criterias at once to the results. Stuck on this one, any help much appreciated. :confused:

View 13 Replies View Related

Criteria To Look Up A Field.

Jan 9, 2007

Nearly finished my 1st database thanks to the people here.
Just need direction on one more thing:-

i need to input a "return date" into a field on a form and then click a button to run a query based on that date field to list all carts to return on that date. We always have to put in different dates and so 1 set query would be no good.
I assume i need some kind of criteria in the query. Anyone help?

Many Thanks Ben

View 2 Replies View Related

Change Field When Criteria Is Met

Jul 1, 2005

You will see it is a simple problem if you know what your are doing.

When entering the joining date I would like the Status to change automatically to Member and when the renewal date is reached I would like the status to automatically change to Renewal but I am unable to work out a formula for this.

Many Thanks,

Fredfox.

View 7 Replies View Related

Query Field Criteria

Oct 4, 2005

I am not sure how to search for this so if there is another thread with this example please direct me in that direction. What I am trying to accomplish in my query is the following:
I am bringing data in from another source in the following table

ID Date1 Date 2

I want a query to do the following based on dates entered on the switchboard in a beginningDate field and EndingDate field

ID Date1 Date2 Final1 FInal2

If Date1 is between beginning and ending date I want it to put a yes in Final1 if Date2 is between beginning and ending date I want it to put a yes in Final2. Both can have yes'.

I tried doing an if statement in my expression as follows: IIF([Date1] between [Forms]![FrmSwitch]![BeginningDate] and [Forms]![FrmSwitch]![EndingDate], "Yes", "") but nothing comes up. My switchboard is always open with the dates in an unbound field.

Any suggestions???

View 5 Replies View Related

Field Indentifiers As Criteria

Oct 5, 2005

I am wondering if it is possible to use a table/field identifier as part of a criteria expression in a query.

The field that I need to use in the expression is not a part of the focus table, so I think I need to use a full identifier, if that is possible. I have seen such identifiers used for controls on forms, but never fields in tables.

For example, something like the following as a criteria expression:

<>[Tables]![tblUserData]![UserId]

Obviously, that didn't work. My question is, is it possible to identify a field from another table as part of a criteria in a query. If so, how?

Just in case it helps, the reason I am doing this is I am trying to create an append query that only appends data that is not already there.

View 5 Replies View Related

Criteria Based On The Value In Another Field

Feb 15, 2006

Hey guys, apologies in advance for a question which you may have answered many times, I have searched the net, my textbook and these forums but to no avail.

I have a table, 'tblStock'.

I have two fields within this table, 'Stock Level' and 'Minimum Stock'.

I want to run a query on this table, finding all records where the value in 'Stock Level' is LOWER than the value in 'Minimum Stock'.

How would I go about setting up this query? What criteria would I type? I have tried typing <"Minimum Stock" in the criteria for 'Stock Level' but it didn't work.

Thanks in advance... this will be a big help. :)

View 7 Replies View Related

Field Specific Criteria

Jun 14, 2006

I have a query drawing information from two tables. The first table has information about a product, and the second table holds all the faults found per product. So any one product can have anything from 1-14 faults. I have created a report from the query, but the Fault item that I put on it only ever shows the first fault for that product. Is there some way of fixing this at report level, or on the query?

The tables are connected through the ID field, but the primary key for the faults table is another autonumber. Ex:

Primary Key___ID___Fault
___1__________ 1____fault 1
___2__________ 1____fault 2

That's two faults for the same product. Maybe I could create new fields in the query like Fault1: [Fault] with criteria set to primary key = 1? And one for each fault? But when I do it, it sets that criteria to the entire query, so the results end up blank because the "primary key" field doesn't exist on the product table.

I guess what I'm asking is can you set a criteria for just one field of your query to follow? Or can I resolve this issue in the report design?

Many thanks,
Tom

View 1 Replies View Related

Search Criteria Within Same Field

Aug 10, 2006

Hi All,


I need to make a search criteria within the same field,
for example here 'Demo' should selected from 'xxx' to 'xxx' number.

Thanks for reading, any suggestion would be appreciated

good day :-)

View 4 Replies View Related

Enabling A Field When Certain Criteria Are Met

Jan 22, 2006

Hi, I have a field in a form that says when you are able to book a certain event, and i want the field in which the event can be booked, to remain unable to be edited until the tick box says yes. Is that possible?

Chris

View 4 Replies View Related

One Field Meets Criteria Of Another?!?!

Jan 16, 2007

Hi,
I have one field, for this example, FieldA and another FieldB.
I would like the following:
If fieldA =1 then FieldB must = 1 or 3 or 4. If not then I would like a message box saying it needs to check. Otherwise I don't want anything to happen.

How can I do this? and where do I put any expressions?
thanks
Sue

View 7 Replies View Related







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