Queries :: Display Expiration Dates For Next 30 Days

Nov 13, 2014

My database keeps track of training for employees, some of which expires after a period of time, which is in the tables. I need to create a query that displays only the employees and the training that expires during the next 30 days. I have a query that displays the expiration date (this field uses DateAdd and adds the expiration term to the date the employee completed the training) I am trying to add a criteria to this field. I found <=Date()+30 in my searches but that displays all of the records from 12/14 and back. I have tried all kinds of versions of this (obviously, not the correct one) and either get all records or none. (Yes there are records in the database that fall within the the period I am trying to display - that is something that I have been known to forget)

Is it because I am using criteria in a field that is based on DateAdd or what would be the correct criteria for this?

View Replies


ADVERTISEMENT

Queries :: Expiration Date - Older Than/ New Than With Dates

Nov 27, 2013

I've built an an update query that updates a Yes/No field "Expired?" to "Yes" if the expiration date has passed i.e. if the current date is newer than the expiration date. I thought this would translate into the current date being greater than the expiration date?

UPDATE Alert
SET Alert.[Expired?] = 'Yes'
WHERE Alert.Current_Date>Alert.Expiration_Date;

When I run this, it identifies the records to be updated, but then stops updating the fields due to "a conversion failure."

View 7 Replies View Related

Queries :: IIF Statement To Calculate Expiration Dates Within Query

Jun 15, 2015

I'm trying to build a query with an iif statement to calculate expiration dates within a query. For some reason what i'm trying to do is not working as expected.

Here's the situation. Every employees with an exception of two employees in the company has an expiration 2 years after the class took place. The two exceptions are the certified instructors who's training certification is good for three years.

I've created a query with the employeeid, training subject, and maxoftraining date.

I'm trying to write an if statement to give me the expiration date based on the above information. Here's what I have so far; however its not calculating based on the criteria.

Expiration: IIf([tblemployee]![EmpID]=1 Or 2,DateAdd("yyyy",3,[maxoftrainingdate]),DateAdd("yyyy",2,[maxoftrainingdate]))

At this point in time, all "expiration" dates are showing + 3 years rather than just the Employee ID's 1 and 2 and the rest +2 years.

View 2 Replies View Related

Queries :: Counting Days Between Dates - Vacation Period And Work Days

Sep 11, 2014

I have a form called subfrm_vactions

rowsource is a query called qryVacations

the query should calculated two things

1 - the difference between start_vac and End_vac in days to calculate the vacation period and put the value in field called Period (working well)

2-the work days which the period between the last day in Previous record (End_Vac) and the (Start_Vac) in the next record (didn't work)

the result is the difference between (End_Vac) and (Start_Vac) in the same record which i don't want

simply i want to calculate the work days.

View 5 Replies View Related

Queries :: Number Of Days Between Two Dates With Irregular Days Worked

Apr 14, 2014

I have a form where a start date is inputted (Inputfrm , StartDate) and a form where the end date of the process is recorded (Inspectionfrm , EndDate) and these both record in the table InputTbl as StartDate and EndDate respectively.

I have created a union query which shows a list of all the dates where there is work recorded (WorkingDatesQry and the column of list of unique dates is "WorkingDate"), and as we run a highly varied schedule depending on time of the year and order numbers I cannot just use a query which says Monday-Friday or Tuesday - Saturday.What I am trying to do is to find the number of days between StartDate and EndDate where there is a date recorded in the WorkingDates query.

View 1 Replies View Related

Queries :: Counting Days Between 2 Dates - Just Workdays

Oct 11, 2013

I have 2 dates that I need to count between. Easy enough just use the datediff right? Nope cause it won't count just the 5 workdays. I researched and found that the "w" in the function doesn't work the way I need it to. I found lots of code to make a module that will do it for me and they all include having a holiday table. Right now I don't need a holiday table I just want the simple dates in between.

View 2 Replies View Related

Creating Database To Manage Expiration Dates Of Medications

May 6, 2014

I am trying to create a database to analyze expiration dates of multiple products.

Let me lay out what I am trying to accomplish.

I have 5 ambulances, each ambulance has the same quantity of medications on it. There are three separate locations medications are stored on each truck. Each month I need to be able to update expiration dates, query what medications will expire by a set date and where exactly they are located.

SO here is the structure as I see it.

Ambulance 1 contains, a drug drawer with approximately 30 different medications, a trauma bag with about 10 different medications, and a blood glucose kit with 2 different medications. Now some of medications are repeated in the different locations, but have different quantities. The medications will never all have the same expiration date, and medication 1 might have 8 vials, where medication 2 may have 4 vials. I would like my form to be dynamic based on the inventory level of the medications. That way if we decide to keep 10 vials instead of 8 the form will then require the 2 extra data points.

The tables I have created so far...

table 1 lists all the ambulances
table 2 lists medications in the drug drawer and the inventory level
table 3 lists medications in the trauma bag and the inventory level
table 4 lists medications in the blood glucose kit and the inventory level

I need to create a table to store my expiration dates for each of the locations in each of the ambulances.

I need to create a form to simplify the entry of the data into those tables and I want the form and table to be dynamic to the inventory level.

View 3 Replies View Related

Queries :: Calculating Days Between Dates From A Specific Record

Dec 14, 2013

I have a query that records a status update, and the date it was made by an employee etc. The table has a secondary key related to ... lets say a project table.

E.g.
Status Id; EmployeeID;ProjectsID;Status;Date

I want to calculate the average amount of days it takes for a status change occur.

View 1 Replies View Related

Queries :: Calculate Number Of Days Between Two Dates Using IIF Statement?

Nov 21, 2014

I'm trying to calculate the number of days between two dates using the iif statement

Fields:
[LDW] "Last Day Worked"
[ReturnedDate]

DESCRIPTION: If ReturnedDate is null, then calculate the datediff "d" between LDW with Now(), if not, then calculate the datediff "d" between LDW with ReturnDate.

I tried this but it didn't work at all.

Days Absent: Iif(isnull([ReturnedDate],(DateDiff("d",[LDW],Now())),(DateDiff("d",[LDW],[ReturnedDate])))

View 2 Replies View Related

MS Access Query Help. Expression For Calculating Multiple Expiration Dates.

Feb 28, 2008

Hi everyone
I'm a very very new access user so many apologies in advance for when I have no idea what I"m talking about.

I'm working on creating a report that will display multiple expiration dates. Currently I have an employee database, not created by me, that has all of our employees professional licenses listed.

Prof license, auto license, liability, etc.

I want to create a report that will tell me what has already expired or will expire in the next 30 days.

I did use this
Between DateAdd("d",-30,Date()) and Date() and it is bringing back info up to 2009. which isn't what I need. I'm sure I'm doing something wrong here.

I want anything that has expired regardless of the date from today, before today, and 30 days from today but I don't care about anything more than 30 days from today's date.

I noticed that when I looked at the existing database that the fields are set as text fields. I tried to change them to dates and it gave me a "deleting 106" records error message. Yikes!

Any help would be appreciated. I don't really understand expressions and I don't understand if I'm supposed to put the actual date in parentheses or what. Please pardon my ignorance.

Many many thanks.

View 14 Replies View Related

Queries :: Calculate Total Number Of Days Between Two Dates In A Query

Feb 18, 2015

Basically I have a report that shows any 'Issues' that wasnt closed within the KPI Target.

I have the report working, but I simply want to do a count of how many days the observations overran the 'Target Date of Closure'.

The report also shows observations that are not closed but passed their Target Date of Closure. These observations will not have a 'Actual Closure Date', but I would like to still have a count of how many days its overrun closure.

This is a formula I tried to piece together but obviously not correct as it's not returning anything;

IIf(IsNull([Issues]![Actual Closure Date]),DateDiff("d",[Issues]![Target Date of Closure],
Date()),DateDiff("d",[Issues]![Target Date of Closure],[Issues]![Actual Closure Date]))

View 2 Replies View Related

Queries :: Create A Query That Will Count The Days Difference Between Two Dates

Jul 3, 2015

I am using Access 2013.I am trying to create a query that will count the days difference between two dates. The dates are in the same field. I want to group by Region.So:

tblRegion = RegionID
tblStatus = StatusDate

I know how to use the DateDiff when it is two different fields, but I can't figure out how to do it from the same field.

View 7 Replies View Related

Queries :: Missing Days - Creating Table With 31 Days Of Zero Values

Apr 3, 2013

Client has asked me to create a report showing summary of monthly sales by day. That was easy. I created a query for the month the user selected and then summarized and group the data by day. Client like the result but would like to see zeros on the report for non sales days. Non sales days are days like holidays and there are no sales.

I am thinking of creating an table with 31 days of zero values and then join the two tables in a query? Or, should I create a temporary table with code and then merge the two tables which the existing query which I can then use for the report?

View 4 Replies View Related

Number Of Days Between Dates

Sep 9, 2006

Hi,

I need to work out a couple of calculations, the number of days between an engineer starting and finishing a project, the number of days between the project being put on the database in the first place and being completed by an engineer and finally, the difference between these. These maybe simple, but I have no idea tbh (still new to access).

I have a form with the date it was added onto the database, and the engineer fills in the date started and date finished as it happens.

These run off of 2 tables BookingIntbl and TechnicalServicestbl

[BookingIntbl].[Date], [TechnicalServicestbl].[Date Started] and [TechnicalServicestbl].[Date Finished]

I have then got the fields, 'Days with Engineer', 'Days in Repair Centre' and 'Day Difference' for the answers to be displayed.

Any help would be appreciated, Ben

View 2 Replies View Related

Calculate Days Between Billing Dates

Oct 6, 2005

I am woking on a project full of nightmares. My latest, and the one I am currently unable to solve, involves trying to calculate the number of days between Billing Dates.

I have a table named "Date" - I didn't design this!
It contains a field named "Date"

If I query for just that Field I get the following:
Date
9/8/2005
8/8/2005
7/8/2005
6/8/2005
5/9/2005
...

I need to figure out a way to determine the number of days between the bills so I can calculate the average cost per day.

It seems like it should be an easy thing using like the datediff function or something, but since they are in separate records (rows), I can't figure it out. I have tried and tried and tried.

Any suggestions would be VERY much appreciated.

View 3 Replies View Related

Calculating Number Of Days Using Dates

Mar 15, 2006

I have a library system and i need to work out the number of days from the date the book was due and the current date. Could anyone help me.

View 2 Replies View Related

Count Working Days Between 2 Dates

Nov 5, 2007

I've had it before, but can't find it.

basically something like this --

DateDiff("w", StartingDate, EndingDate)


that also makes sure date is not in tblHolidays.
anyone knows how to acomplish this ?

View 1 Replies View Related

Calculate Days Between Dates & Other Criteria

Dec 9, 2007

I have a database with 10-12 fields containing dates certain things were completed. There is also a field for the 3 different locations we have and a program year 2006, 2007, or 2008. What they would like to do is click a button and get a list to choose the first date they which to compare, then a list to choose the second date, calculate the number of days between the two dates, select the program year from a list, and a location from a list. Can anyone help me with how to do this if it's possible?

The fields look something like this:

Prog Year Location DateA Date B DateC DateE
2006 G date date date date
2006 G date date date date
2006 P date date date date
2008 D date date date date
2007 P date date date date

For Example, I might want 2006 Program Year, Location P, calculating days between DateA and DateB, except that the next time I might want to choose a different set of criteria.

Any ideas?

THANK YOU!

View 7 Replies View Related

Problem With Calculating Days Between Dates

Dec 9, 2005

I have a form with two date fields: "Initiation_date", and "Correction_date". There is a third field called "Duration". I would like to store the values of all three fields in the corresponding table. "Duration" (Long Integer) would be the number of days from "Initiation_Date" to "Correction_Date" if Correction date is there, or to Date() if Correction date is Null.

I can use an unbound text box to get "Duration_cal" using the following as a control source:

=IIf(IsNull([VCor_date]),DateDiff("d",[VInit_date],Date()),DateDiff("d",[VInit_date],[VCor_date]))

But I cannot get that value (No.of Days) in to the "Duration" field. The reason I want to have "Duration" stored as a number is that it is being used in a query for another calculation (total days used for selected records).

Is there a simple way to accomplish this?

Thanks

View 1 Replies View Related

Number Of Days Between Dates In Query

Apr 22, 2005

I want the number of days between a specific date (roll out date) and 12/31/2005 so that
I can use the number to project revenue for this year.

This is what I'm using but it doesn't give me the right number. I don't know how to transform
something to a datetime variable so maybe that's the reason. Can you help me out?

Expr4: Day(12/31/2005-[Scheduled Roll Out Date]-0.49999)

View 1 Replies View Related

Counting Working Days Between Dates

Feb 1, 2006

I would like to count the number of working days between two dates, NOT the calendar days, if the workers only work Monday thru Thursday. I know we could use the DateDiff function, but HOW do I count excluding Fridays, Saturdays, Sundays?

Thank you for your help.

View 1 Replies View Related

Modules & VBA :: Working Days Between Two Dates

Jan 26, 2015

I am trying to carryout working days between two dates (Excluding weekends Friday & Saturday) but unable to fix it correctly, However i did search a lot over internet also about built in function but all is showing i have to add it module or macro etc.So, i select the module for Access 2010 but also not finish with function.Table name is "LeaveSettlement" and column name is "Total_Wdays", what field type i have to select for result column.

Public Function LeaveSettlement(ByRef Leave_Start As Date, _
ByRef Leave_End As Date _
) As Integer
' Returns the number of weekdays in the period from Leave_Start
' to Leave_End inclusive. Returns -1 if an error occurs.
' If your weekend days do not include Saturday and Friday and
' do not total two per week in number, this function will
' require modification.

[code]...

View 8 Replies View Related

Calculate How Many Weekend Days Are Between 2 Dates

Aug 17, 2015

I'm trying to create a sub to count how many days between 2 dates excluding Holiday and weekend. Using the DateDiff() function is not allowing me to exclude certain days.

View 2 Replies View Related

Display Only The Last 3 Days In A Cobbo Box?

Nov 10, 2005

Hi i have a query named "query-shifts" which has a field in it named: "shift_date" a form named: "Form-Attendance" reads information into this query, is is possible to have a drop down list box (combo box) which displays just the last 3 days (including the current date), i would like the user to be able to select one of these dates and store it.

ive tried the following code in the criteria field of "shift_date" in the query:

>=DateAdd("d",-3,Date())


and have created a cobo box in the form that looks at this field in the query, it does display the last 3 days in the drop down list but shows each date twice, i think this is because i have different shifts in the query with the same date, any help on how i can just show the last three dates the once would be great?

View 2 Replies View Related

Difference Between Two Dates Into Years Months Days

Aug 31, 2006

Hello to everybody.

I have a problem in calculating the difference between two dates and displaying the output into Years Months Weeks Days. My problem is that dividing the number of days by 30 and requesting an integer is not accurate enough. I have looked at Pat and Jons examples shown in these threads

http://www.access-programmers.co.uk/forums/showthread.php?t=67472

http://www.access-programmers.co.uk/forums/showthread.php?t=89051&highlight=calculating+number+months

which either method would suit me as the accurate answer is what I am after.

My problem is that not all of my records would have a start and end date. Therefore both examples would result in an error.

Can anyone please give a hint on how to perform the calculations on those fields which have dates recording the results but ignoring those fileds which do not have a start / end date.

I am having a bad day and I'm sure the answer is so easy that I am going to kick myself but having played around with the modules by limited knowledge is not enough.

Many thanks in advance

Ian

View 3 Replies View Related

Modules & VBA :: Grab And Calculate Days Between Two Dates

Feb 11, 2015

What I have is two fields, one is a simple date and the other is slightly more complex as it holds a date but in a different structure (a dated case number).

The case numbers are for example, 150211551223 the date being the first 6 numbers and equaling to 11/02/2015. so the code will need to grab this data, spin it around and convert it.

The formula will then be:

simpledate - convertedcasenumberdate = days between.

(simpledate will always be the latest date of the two).

View 7 Replies View Related







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