Question About Searching For One Date Accross Multiple Date Fields. Thanks!

Jan 12, 2007

I am currently building a booking and invoicing database for the small business where I work. One aspect of this database allows you to enter an employee name and schedule days off via a form I have already built. To access this information I would like a parameter query where you can enter a date once and then have this date looked up across a number of date fields. Here are my table column headings:

ID
Employee Name
Date 1
Date 2
Date 3
Date 4
Date 5
Date 6
Date 7
....etc

So, basically, the parameter query would ask "What date?" which the person would enter, and then search all 12 date fields to see if the date was contained in any one of them. Then it would pull any records which did have the date in one of the fields.

It seems really simple but I have searched and searched and can't seem to find the answer. Tried a multivalue field but does not seem to work.

Thanks very much, any help appreciated! Elspeth :confused:

View Replies


ADVERTISEMENT

Select MAX Date From Multiple Date Fields?

Oct 20, 2005

Is it possible to select 1 MAX date from multiple date fields for a record?

For example, on an employee record there are 10 date fields, each for a performance review date. Some employees may have date fields 1-3 with values, some with just 1, others 1-5, etc.....depending on how many performance reviews they've had.

Is there a way to pull the MAX review date for an employee, knowing that the MAX date could reside in Field 1 for a certain employee, and could be from Field 7 for another?

I appreciate the help guys!

View 1 Replies View Related

Query Accross Multiple Tables

Jul 13, 2007

Not sure if this belongs in Queries or Tables or Forms, but I'm realy stuck on this one. I've been quite verbose in my question, so please stick with me on this, but I'm trying to make sure you helpful souls have all the information you need.

The premise, is as follows:

Master table recording general appointment details (time place etc)

For each appointment we have a number of tests that need to be performed. What I have been asked to provide is the following:

For each appointment there must be one or many tests.

For each test, there must be 1 or many sub tests.

The test number is just an integer

Each SubTest has a code, description, price. The price for each test is date dependant. The operator should just be able to enter the sub test code and autopopulate the remaining fields.

So, I want to add a subform in a subform to the main appointment form.

The tables are as follows (Excluding appointment table):

tbl_Test
Test_Number_PK (AutoCounter)
Appointment_Number_FK
Test_Comments

tbl_link_Test_to_Sub_Test
Test_Number_PK (Composite Primary Key)
Test_Code_PK

tbl_Test_Code
Test_Code_PK
Test_Desc

tbl_Test_Code_Price
Test_Code_PK
Price_Date_PK
Price

Now, as the price is dative I have a query on a query (both select queries) to get the prices as of the appointment date. This works fine:

First Filter:

SELECT tbl_Test_Code_Price.Test_Code_PK, tbl_Test_Code_Price.Price_Date_PK, tbl_Test_Code_Price.Price, tbl_Test_Code.Test_Desc
FROM tbl_Test_Code INNER JOIN tbl_Test_Code_Price ON tbl_Test_Code.Test_Code_PK = tbl_Test_Code_Price.Test_Code_PK
WHERE (((tbl_Test_Code_Price.Price_Date_PK)>=#1/1/2007#));

**Note I've just set the Where statement as a dummy value in order to test**

Second Filter:

SELECT qry_first_filter.Test_Code_PK, Max(qry_first_filter.Price_Date_PK) AS MaxOfPrice_Date, qry_first_filter.Price, qry_first_filter.Test_Desc
FROM qry_first_filter
GROUP BY qry_first_filter.Test_Code_PK, qry_first_filter.Price, qry_first_filter.Test_Desc;


I've added the link table to get over the many to many relationship I have between Tests and Test Codes.

As soon as I try and link the tables or tables + query together for the sub sub form (i.e. the test codes data entry)it all goes wrong. I get no option to add data....

Linking the tbl_lnk to Second Filter:

SELECT tbl_Link_Test_To_Sub_Test.Test_Number_PK, tbl_Link_Test_To_Sub_Test.Test_Code_PK, qry_second_filter.MaxOfPrice_Date, qry_second_filter.Price, qry_second_filter.Test_Desc
FROM tbl_Link_Test_To_Sub_Test LEFT JOIN qry_second_filter ON tbl_Link_Test_To_Sub_Test.Test_Code_PK = qry_second_filter.Test_Code_PK;

Or Simply trying to link the tables:

SELECT tbl_Link_Test_To_Sub_Test.Test_Code_PK, tbl_Test_Code.Test_Desc, tbl_Test_Code_Price.Price_Date_PK, tbl_Test_Code_Price.Price
FROM (tbl_Test_Code INNER JOIN tbl_Link_Test_To_Sub_Test ON tbl_Test_Code.Test_Code_PK = tbl_Link_Test_To_Sub_Test.Test_Code_PK) INNER JOIN tbl_Test_Code_Price ON tbl_Test_Code.Test_Code_PK = tbl_Test_Code_Price.Test_Code_PK;

If I manually enter the data into the seperate tables it works fine, and will display correctly on the Appointments form, but you still cannot edit/add records - the error is that this recordset is not updatable.

So, firstly, have I set the tables up correctly? secondly if yes, Am I using the correct approach to this? If yes to both, where am I going wrong? Do I need to create a table from the pricing query or is it much simpler?

Thanks in advance

View 5 Replies View Related

Modules & VBA :: Date Field To AutoPopulate Other Date Fields To Future Date

Oct 24, 2013

I'm trying to get my "IncidentDate" field to autopopulate two other date fields to a few days from the "IncidentDate". The other two date fields are "ContainDueDate" and "RootDueDate". I'm trying to accomplish this on my "Test CAP Form"

I tried using the following in the BeforeUpdate of "ContainDueDate" and received a complier error: expected =

Code : DateAdd(d,2,[IncidentDate])

so I removed the parenthesis and nothing happened

Code : DateAdd d,2,[IncidentDate]

I even tried redoing it in the AfterUpdate of "IncidentDate" and nothing happened either

Code : DateAdd d,2,[ContainDueDate]

I'm not sure if I'm even using the right function to get what I want.

View 4 Replies View Related

Between Date Query/multiple Fields

Nov 13, 2006

Hi! My question is similar to Hondasteed earlier today but a little different. I have a database that has 6 date fields. I would like to develop a query where the user enters a start and end date and the query checks all six of those fields for the appropriate dates and shows only those records who have dates in that range. The dates would change each month as we ran the query again. I would appreciate any help as this has really had me stuck and I'm guessing it's a simple solution. Thanks!

View 6 Replies View Related

Forms :: Filling Multiple Date Fields In The Form With First Value

Mar 3, 2015

I have a table where I use 3 date fields in, all with different views.

Field 1: Date as dd/mm/yyyy
Field 2: Quarter: q (shows the same date, but then as quarter of the year.
Field 3: Year: YYYY

Now I have a form that fills all of my fields, but is there a simple way () to populate the other two fields Quarter and Year from the value I entered in Date?
So if I change Field "Date", Fields "Quarter" and "Year" updates as well.

Maybe I don't need to do it in the form, but in the table?

I'm not that good with VB- scripts, and I'm not sure If it is possible to auto populate the table field Quarter and Year directly in the table itself.

View 7 Replies View Related

Modules & VBA :: Show Latest Date From Multiple Fields?

Aug 10, 2015

I'm trying to create a query that has a calculated field that shows a maximum value from multiple fields.

As far as I can find, this is not built into Access, so I've used this code from a Microsoft page:

Code:
Function Maximum(ParamArray FieldArray() As Variant)
' Declare the two local variables.
Dim I As Integer
Dim currentVal As Variant
' Set the variable currentVal equal to the array of values.

[code]....

The problem I'm having is, well this doesn't work for me.I'm a bit of an beginner VBA coder, but I understand this code and don't know why it won't work.It only displays the value from the field within the brackets.The values used are Dates, so I need to display the latest date from multiple fields.

View 13 Replies View Related

Queries :: Date Range Search Of Multiple Fields

Nov 24, 2013

I am building Access (2013) database for 100+ employees to keep track of their expiry dates of visa/passport/work permits, for that to work I need to be able to search between date range to generate a report to work on. please check out the image attached as it will explain better where I am stuck, with current settings access keeps giving me empty query table as I think it searches for exact same result in all 3 fields at the same time. But I want it to search between all 3 fields and display if any of the 3 fields falls into that range.

View 3 Replies View Related

Modify Date / Time For Multiple Fields In The Record

Jul 2, 2014

automatically adding modified date/time to a record as it changes..I have a work log database for a team of people to keep track of workflow (documents in/out, stage in the workflow, owner of the record, etc.). I have a number of records that I want to automatically update a corresponding date/time field when it is changed. For example, one part of the workflow tracks a document through the approval of 5 different people. So I have a five records that are yes/no flags for approval and five records that are date/time for when it was approved. Right now my team is manually entering the five date/time stamps, but I'd like to have it automatically update when the check the "yes" box and update that field in the record.

View 8 Replies View Related

Creating Expression On Multiple Date Fields In A Query

Jun 12, 2014

I am trying to create an expression in a query to sum only the # of hours a student attended between two date fields. I do not want to use a parameter because each student has different start and midpoint dates and I need to see all of them in one list.These are the fields I'm using in the query:

Student Name
Start Date
Midpoint Date
Hours

It keeps giving me "0" or if I move the () around it says the correct syntax is [NOT]

Expr1: Sum([Hours]) between [Start Date] & [Midpoint]))

View 14 Replies View Related

Summary (Count) Of Multiple Date Fields By Month

Feb 13, 2014

What I have: A table with multiple Date/Time columns. Here's an example:

What I would like: A month-by-month summary counting the number of entries in each of the three columns, like this:

I'm indifferent as to what happens with the months zeros across all three fields (whether they show up in the report with zeros or are omitted altogether).

Smaller Pieces: I am able to create such a summary for one column at a time:

Not what I'm looking for: I can not figure out how to create a query that does this for all three columns. My best attempt was a disaster:

I have attached the example file for your convenience: Database1.accdb

To clarify, my issue isn't the format of the date. I know about the Month(...) function. My question is regarding how to count this data and split it into a month-by-month summary (see the picture above in the "What I would like:" section)

View 6 Replies View Related

Searching For Record By Multiple Fields

Sep 9, 2006

Hi,

Not sure where to put this, but as I want the information to be shown in form view, I guess this is the bext place to start.

In breif, I have created a database, in which infomation on machinery is held.

The problem I am having (atm), is I have to create a function, which I want to be presented in form form, where by each item can be searched by it's RequestID (unique) or the customer who owns it, so that its current location can be attached (or viewed).

I'm not sure whether i've worded this well, so to sumerise:

I need a form with 3 fields, RequestID, Customer and Location.

Where by I input the RequestID, which brings up the Customer and Location, or input Customer which brings up the RequestID and Location (obviously there will be mulitple results from Customer search).

Again, I hope I haven't confused anyone because it's pretty simple what i'm trying to say, but....

Thanks, Ben

View 1 Replies View Related

Show Multiple Fields As One, For Searching Purposes.

Dec 8, 2006

Hello everyone,

Im trying to set up a combobox on my Customer Contact Information form, where you can enter a phone/fax/cell/pager or any misc number, and it will bring up the appropriate customer.

Is it possible to make a query that will show the different phone number fields as one field?

Thank you so much for your help, and please let me know if I can clarify anything.

-Ben Bolduc

View 3 Replies View Related

Date Searching

Nov 12, 2005

I have a date base where i am looking for all records which are not scanned every time an order is entered a date is generated. I then want to find all the ones which have not scanned for today. (i know i can do this by a query i.e [Date] =date() .)

Now the problem is that if nothing is entered in today for example i then want to find the next day something was entered.

I am a novice with access and i think there must be some coding which i need to create in a module prehaps but i am unsure. Could any one assist??

View 6 Replies View Related

Queries :: Getting A Query On Multiple Checkbox Fields To Work With A Date Range?

Nov 7, 2014

I have developed a database which has required many checkbox fields to enable analysis. It requires to have the facility to input random/variable date ranges for statistical purposes.

I have built a query which obtains the counts of multiple fields using the following parameters in Query Builder in Access 2010. Although this comes up with the correct results for these multiple fields when I try introduce date range the results come up blank for all results.

An example of the parameters used for one of the checkbox fields in Query Builder is as follows:

Field: SumAnger: Sum([Anger]*-1)
Table: Default as only one table
Total: Expression
Show: Checked

This works fine.

My latest parameters for the date range are this:

Field: [cDate]
Table: Default as only one table
Total: WHERE Corrected! Whoops Copy & Paste Typo. Too early AM!
Show: Checked or Unchecked makes no difference
Criteria: Between [From Date:] And [To Date:]

This gives a statement in SQL view of:

SELECT Sum([Anger]*-1) AS SumAnger, Sum([Anxiety]*-1) AS SumAnxiety, Sum([Depression]*-1) AS SumDepression, Sum([Listening]*-1) AS SumListenig, Sum([Psychosis]*-1) AS SumPsychosis, Sum([Stress]*-1) AS SumStress, Sum([Other]*-1) AS SumOther, tblCommsLog.[cDate]
FROM tblCommsLog
WHERE (((tblCommsLog.[cDate]) Between [From Date:] And [To Date:]));

what I need to get this to work in Query Builder or failing that recommend some VBA script/code with embedded SQL to achieve the required report.

View 1 Replies View Related

Searching By Date Reference...

Nov 26, 2007

Hi,

i have a START date "DD/MM/YYYY" <-- with 3 combo boxes "cboStartDD", "cboStartMM", "cboStartYYYY".

i have a END date "DD/MM/YYYY" <-- with 3 combo boxes "cboEndDD", "cboEndMM", "cboEndYYYY".

i have a Search command buttom.

upon a "search" button is click,

how can i search the dates in the table with "tblDate" (column) that matches the date ranges from the START date to the END date?

by using sql statement...

thank you.

View 5 Replies View Related

Searching For Records Between A Certain Date

Dec 2, 2007

Lets say i have records that contain the following dates

09/06/07

14/06/07

20/06/07

31/06/07

14/07/07

And i wanted to know what records contain anything between 09/06/07 and 31/06/07 so it would show the records that have this in the date field

09/06/07

14/06/07

20/06/07

31/06/07

What would be the best way to do this

Thanks in advance

View 10 Replies View Related

Display Fields As Column Showing Date One Month After The Date In Field Above

Jun 2, 2015

I am creating a repayment schedule (as a report) and I want to display a series of fields as a column which return (show) a date one month after the date in the field above.

The first repayment date field (Line 1) will show a date one month after the loan was paid out. the Next field below will show the date one month later.

I can't simply insert the "Date + 30" because that would get out of since over the year. If the loan was issued on say the 15th of January, I need the first field to display 15th February and the next would be .... 15th March.... Yes - You've got it!

Now I could do that in Excel, but I don't know how to get Access to do it.

View 4 Replies View Related

Searching By Date Doesn't Work

May 11, 2006

I have a table called tblorders for orders. So I have a form for this, frmOrders.

I also have a form to perform various searches on the orders. So I have a date textbox on this search form and a command button which I want to open the frmOrders according to the date I enter in the textbox. But even though the date on the search form matches the date in tblorders it does open the relevant record??!!

The date textbox is linked to the date field in the tblorders but it doesn't recognise it even if the date is correct! Everything is set to Format: Short date

Any ideas? This system works for other things like serial number etc but not the date for some reason.

Thanks.

View 5 Replies View Related

Queries :: Searching Date Before And Using This In WHERE Condition

Sep 13, 2013

I have a table that has 4 fields; id_vl, id_product, date_vl, vl.

Basically each product is valued either on a monthly, weekly or daily basis. I want to create a filter that is based on a text box that filters the dates from which one can look at the dates of valuation and the associated values.

The problem comes with the products valued on a weekly or monthly basis. For example, if I simply say [tblvl].[date_vl]>=Me.textbox, and me.textbox = 13/09/2013, yet the last value date for a weekly product was 09/09/2013, this record won't be included. Therefore I need to set the date of the previous record as the filter. This is my attempt but it doesnt work...

Code:
SELECT tblVL.Id_VL, tblVL.Id_Product, tblVL.Date_VL, tblVL.VL,

FROM tblVL
WHERE iif(tblvl.date_vl<>me.fees_start_date, [tblVL].Date_VL>=(SELECT
MAX(PrevDate.Date_VL)
FROM tblVL AS PrevDate WHERE PrevDate.Date_VL<[tblVL].[Date_VL] AND PrevDate.Id_Product=tblVL.Id_Product;),tblvl.date_vl>=Me.fees_start_date)
;

View 1 Replies View Related

List All Clients In A Specific Date From 3 Date Fields

Oct 12, 2007

Ok let me explainI have a list of 50 people who may have accessed events A,B,C at different times but what I want to do is to put a date in my form, run the quaery which will list all people who have Attended A,B or CWhen I do my normal query, I put the fields in, but if I put a date filter in Event A, it will not show up any person who may have attended event B but not Event A.I thought about running an append query but this would mean running the data several times with possible duplication of client names.Ideally I would like to have my report to showDate: 31/07/2006Name A B CK.Brown Y YJ Blogg Y YK Smith YK Ellum Y Ythen I can just use a count at the bottom :)The methods I have tired will filter event date A, but will not show J BloggIf I create another append for Event B, and append that data to a table, then I will have duplicaion of K Brown.. Any Help Appreciated.Last thing - when I run the append queriy and get my duplications, the fields where I had a Y/N option - if it was YES then I get a -1 instead of 1 ??? Why? and how do I make sure that when appending that the Y answer is a 1 not a -1

View 14 Replies View Related

Forms :: Date Field That Can Trigger Other Date Fields?

Oct 30, 2014

Working in MS Access 2010. Data must be entered and updated in Access only. Trying to figure out if it's even possible to auto populate dates in multiple fields in a form that are triggered when I enter ANY date in a primary date field on the form. I have close to half a dozen fields I'd like to do this for but here are a couple of the fields I'm working with:

Re Insp Date 90 Day Notice(Form field to be triggered and show a date 90 days prior to the trigger date)
Re Insp Date 60 Day Notice (Form field to be triggered and show a date 60 days prior to the trigger date)
Re Insp Date (Trigger date)

What I'd like to do is enter values in the "Re Insp Date" field (in the form) and have it trigger/auto-fill/auto-populate the "Re Insp Date 90 Day Notice" so that it shows the date 90 days prior to the "Re Insp Date" and the "Re Insp Date 60 Day Notice" so that it shows the date 60 days prior to the "Re Insp Date"........all this, and have it auto-update the queries and tables its linked to.

I've tried looking online and in instructional material to see if there is a formula, equation, macro, an expression or VBA coding that I can use to execute this but am having no luck.

The MAIN OBJECTIVE is to have the the linked query and table update automatically. Possible??

I have tried doing =([Re Insp Date])-90 but no dice...

View 2 Replies View Related

Queries :: Hiding Date Picker From Date Fields

Nov 5, 2013

The query is there to query data, not to edit data or manipulate data in anyway. However, I am disgusted by the appearance of the date picker when I pick a field that is a date field.

Is there a way to hide/remove these date pickers from the query sheet?

Within the table itself I turned the "Show date picker" property to "Never" but that didn't make a difference.

View 2 Replies View Related

Select Statement Searching On Date Criteria

Feb 23, 2006

Hello everyone! :)

I've been banging my head of a brick wall with this one. Its probably straight forward... but I can't see the solution! A problem shared is a problem halved... or so they say!

Ok I have this table called CustomerComments. In it are the following columns

CustID
Comment
CommentDate

For each custID I want the most recent commentdate and its matching comment from that row... (there can be multilple comments recorded per custID)

Problem is I can't seem to get this to work.. instead its returning all rows. I have run a query that will sort and group this list. The top line of the grouping gives the most recent comment and commentdate per customer.

Does anyone know how I could just get that top line per custID rather than all rows returned?

Thanks for reading this... hope it makes sense!

:)

View 4 Replies View Related

Modules & VBA :: Search Form / Searching By Date

Jun 3, 2014

The database is a patient database used for tracking Inpatient data and Handover (or Handoffs for those in the US). It has been merrily ticking over since December and has accrued several thousand records. To get access to this data in new and interesting ways Im trying evolve my rudimentary search function which currently only works for diagnosis, name and consultant (in otherword text fields).

Thus I have an unbound form that has various input boxes on it. I have borrowed some code to power the form and have replaced with own fields:

Code:

Dim criteria As String

Looks for input text and adds it to the final criteria to power the search list at the end based on field in this case txtDiagnosis

If Not IsNull(Me.txtDiagnosis) Then

If criteria <> "" Then criteria criteria & " and "
criteria = criteria & "txtDiagnosis like " & Chr(34) & "*" & Me.txtDiagnosis & "*" & Chr(34)
End If

[code]...

ISSUE 1:
I am struggling with the date search function. It doesn't work. Whether it is prudent to search for either a admitted date or a discharged date?

ISSUE 2:
I have a check box for "complications" that I'd like to be included on in the search.

View 11 Replies View Related

Reports :: Searching Year On Date Time Value

Dec 28, 2013

i'm trying to filter is a datetime value and it just doesn't whant to work.I tried to make a separate unbound text field to filter out the Datetime into year and then filter that field out with year but it doesn't work. What I did:

-I clicked on the control element of the unbound text field.
-made a expression with this code : datepart ("YYYY", [BeginDatetime])
-(BeginDateTime is a table value)
-After this one it keeps showing me this error :
-"the syntax of the expression You've taken specified is invalid"

View 1 Replies View Related







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