Query The Occurrence Of A Particular Absent Reason In Past 12 Months?

Sep 3, 2005

Hi, i have a query which looks at a table named "attendance" the query includes the fields: "employee number", "absent code" (a 3 letter code), "absent reason" (list of different reasons) "shiftdate" (weekly shift dates in format: DD/MM/YYYY). If possible i would like to be able to promt the user to enter a employee number, then a absent reason (ideally from a list box) and show all occurences (with all the shiftdates) only of that particular absent reason within the last 12 months, and ideally calculates in another field the number of times that employee has been absent for that particular reason for the last 12 months.

Does this make sence?, i know how to promt the user to enter a employee number but not sure how to go about the rest, any help with what seems to be quite a challenging task to me would be excellent.

View Replies


ADVERTISEMENT

Query To Pull Past 3 Months

May 22, 2007

I have a query that I need to always pull data from the newest past 3 months, so if this query were ran today it would take from months 2,3,4 (Feb, Mar, Apr). Any clue on how to do this?

View 14 Replies View Related

Queries :: Date Criteria - Query Previous 12 Months Including Months With No Data

Mar 22, 2013

I currently have a form where users can enter an "End Date", click a button, and it queries the data from 12 months prior to "End Date" entered.

Is there a way to force the query to show all 12 months, even if there are no records for a particular month? For example: if the user enters February 2013 in the date field, I would like the query to return:

March 2012
April 2012
May 2012
June 2012
July 2012
August 2012
September 2012
October 2012
November 2012
December 2012
January 2013
February 2013

...so even if June 2012 has no records, it is included in the query with a value of zero.

This is what I have so far:

WHERE (((Qry_Tbl_Assets.Dte) Between DateAdd("m",-12,[Forms]![Main_screen]![End_Date]) And [Forms]![Main_screen]![End_Date]))

View 2 Replies View Related

Query Expression To Find Records 30 Days Past Due

Mar 22, 2005

I am trying to run a query to print invoices that are 30, 60, and 90 days past due. What expression do I use to search for records that were purchased 30, 60, 90 days prior? I was able to find the expression to add time for the due date but was unable to find the expression to subtract time for my search. Thanks for any help!! Beck

View 1 Replies View Related

General :: Date Query Not Extending Past The New Year?

Jan 2, 2014

Now that the year has moved into 2014, the query below no longer works. It appears that it is not extending back into 2013.

Code:

Private Function multiDateClause(dateStartQry As String, dateEndQry As String, firstOp As String, secondOp As String)
multiDateClause = dateClause(dateStartQry, firstOp) & " AND " & dateClause(dateEndQry, secondOp)
End Function
Private Sub b_last7_Click()
Me.resultsFrame.SourceObject = "FollowUp_bystaff"
Me.resultsFrame.Form.RecordSource = todoListQry(multiDateClause("Date()-6", "Date()", ">=", "<="))
End Sub

View 8 Replies View Related

Reason Of ACCESS Failiurs

Jul 23, 2005

Hi Guys
I want to ask you that what are the main reason that Microsoft Access is not using in large companies. I want to ask you that "Is that true that M-access can,t bear the too much records in one database and it slows down.My friend ask me that if we use backend of sql server and front end of Microsoft Access then what will happen? Is there any chance to increase the performance of Access based software by this method


Anxiously Waiting : Sohaib

View 2 Replies View Related

Modules & VBA :: Database Quits For No Apparent Reason

Jul 15, 2014

I'm having a weird problem in VBA on a button click. For no apparent reason the database closes itself. No error, no crash - it just closes. I've compacted and repaired it, recompiled it, but still exactly the same. The strange thing is, if I insert a blank message box at the point in the code where it quits, everything then works perfectly!

Also, if you leave Text4 empty so that it displays the message box telling you to enter a code to start, when you then enter something the next time it also works perfectly. Somehow the process of displaying the message box seems to fix whatever the problem is. I've tried pausing the code at that point, I've tried changing the focus to a different control or another form.

Here's the code:

Private Sub cmdReqLookup_Click()
Dim strTaleoReq As String
Dim strTaleoID As String
Dim intIDMatches As Integer
Dim strContractID As String

[Code] .....

'This is where the database quits. If I add a message box here, it then runs perfectly!

'Disable button
Me.cmdReqLookup.Caption = "Please wait..."
Me.cmdReqLookup.ForeColor = vbRed
Me.cmdReqLookup.Enabled = False
Me.Refresh
ScriptHold (1)

[Code] ....

View 14 Replies View Related

Forms :: Subforms Randomly Appear And Disappear For No Apparent Reason

Aug 2, 2013

I've created a database with multiple subforms within the form; however some of the subforms randomly appear and disappear for no apparent reason.

View 2 Replies View Related

Queries :: Replace First Occurrence Of A String

Jan 12, 2015

Here are the 2 tables that I am working with:

Account

Account
0041980041
0051670051
0052330052
0053490053

Conversion

Account Conversion
0041 10000151
0051 10000152
0052 10000153
0053 100001524

I need to update the Account table using the Conversion table by replacing the first 4 digits in the Account table with the Conversion value. For example, the first record should be updated from 0041980041 to 10000151980041.

View 4 Replies View Related

Find The First Occurrence Of Multiple Record Entries

Mar 8, 2008

As my screen name implies, I am a new to Access and I’m seeking some input to resolve an issue. I have tried numerous queries, read MSDN forums and Access help w/o success. I hope someone would have some ideas.

See ATTACHMENT for screen shot of the following scenario:

Two tables in a one-to-many relationship. The parent table (tblAdmByWard) contains the autonumber primary key (PatientID) and additional fields that will not change while the child table (tblContStayEval) has a corresponding field (i.e. PatientID) to secure referential integrity PLUS additional fields as shown that are evaluated and updated daily. During the update the current date is entered (DateOfReview) along with additional info thus creating a new daily record in the child table.

I would like to query the child table (tblContStayEval) to find and return ONLY the first occurrence (DateOfReview) that the criteria (Variance) was selected…i.e.2/24/2008 as illustrated in the screen shot. This needs to occur for all (PatientID) records but exclude any subsequent and/or similar selections. By “similar” I mean the date will be different for each record in the child table while the data in the other associated fields may or may not be.

I hope I explained this okay as I’m not sure how to go about this. Any ideas or thoughts would be appreciated.

View 2 Replies View Related

Parsing Through A String And Counting Number Of Occurrence

Feb 12, 2013

I have about 150k rows that look like this

SHORT_DESCRIPTION
unable to view
unable to send out some stuff
what is going on

Is it possible for access to query through each field, and tell me the total number of occurence for each word? In this small example, the output would be:

Unable 2
to 2
view 1
send 1
out 1
some 1
stuff 1
what 1
is 1
going 1
on 1

Is this possible?

View 6 Replies View Related

Forms :: Make Multiple Records Based On Occurrence

Dec 13, 2013

I am making a database that has to do with Preventive maintenance. Everything is going good and I came to a problem. There are recurring events. Some are weekly monthly quarterly etc all the way to 5 years. When I put in the task and a start date and the occurrence. So Say I put in a date of a task for today and its set to monthly I want the next record to be 1/13/14 for the task and go all the way up to infinity until a box is checked making it inactive.

View 14 Replies View Related

General :: Display Count Of Today Occurrence From A Table In A Form?

Apr 21, 2015

My database contains a table that has two fields named 'occurance1' and 'occurance2', both containing a range of different dates. In a form I have in that database, I would like to have a field displaying the total counts for both 'occurance1' and 'occurance2', but only the count for both occurances that have 'Today' as a date. Preferably without having to run yet another query, so if possible I would like that as soon as an occurance that has 'today' as a date is entered in the table, the total count shows correctly in the form.

View 11 Replies View Related

&gt; 6 Months Query

Feb 27, 2007

How do I write an expression to pull data greater than six months from a user entered date.

View 3 Replies View Related

Queries :: Determine Gender Ratio Of Associations Membership - Percentage Occurrence

Apr 28, 2014

I have a very simple query to determine the gender ratio of an associations membership. My SQL code neatly calculates the number of females, viz

SELECT [Mail List].[GENDER], Count([Mail List].[GENDER]) AS TOTAL
FROM [Mail List]
WHERE ((([Mail List].[GENDER])="F"))
GROUP BY [Mail List].GENDER;

However, I wish to present this result as a percentage of total membership.

My main Table has a column titled [Member Name] so my requirement is to produce a calculation of the form "Females"/"Member Name Total" all multipliied by 100.

View 2 Replies View Related

Crosstab Query For Last 6 Months

Jun 28, 2005

Is there something I can put into the criteria of a date box to only use the last 6 months. I dont want have have to do this type of criteria: >12/1/2004. I want it to just use information from the last 6 months no matter what the current month is. If anyone knows what I am trying to say, please help me out! Thanks

Bowes

View 4 Replies View Related

Months In Date Order On Query

Nov 29, 2005

I have a combo box that contains the months. They appear in month order on the form but when I query, they are in alphabetical. How can I get this to be in month order on the query?

View 12 Replies View Related

Query To Look For Previous Months Data

Jun 1, 2005

Hey Guys,

I've been racking my brains on this one and need your help. I was asked this question by a friend who has just set up a database for a non-profit organisation in the UK. I have attached an simple example database to illustrate the problem.

There is a table called "tblMembers" which contains data on members of clubs and the dates their membership expires.

There is a query called "qryExpiryCrossCheck" and it needs to display people whose membership has expired in the previous month (i.e. May 2005).

Sounds easy? Well the query needs to know that 'now' is June 2005 and that the previous month is May 2005 and then as I said display people whose membership has expired in the previous month.

Any ideas/solutions would be greatly appreciated. As I said this is a favour for a friend who is carrying out some free work for a non-profit organisation.

Cheers,

Rusty
:D

View 3 Replies View Related

Display 12 Months On A Crosstab Query?

Nov 30, 2005

Ok,

I have a table with 3 fields Line address, Availability, Relevance Date
Every month i put in the data given and i have back from june (so i dont actually have 12 months.

At the moment i am grouping by line address(Row header) and datepart("m",[relevance date]) - (column header) and have the availability as a value and sum. Because i only have data from june it only gives me 6,7,8,9,10. How do i get it to always display 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 and just put the availability into the relevant months and put nothin in the others.

Current SQL: -

TRANSFORM Sum(Monthly_cleansed_data.Availability) AS SumOfAvailability
SELECT Monthly_cleansed_data.[Line Address] AS LineID
FROM Monthly_cleansed_data
GROUP BY Monthly_cleansed_data.[Line Address]
ORDER BY Monthly_cleansed_data.[Line Address]
PIVOT DatePart("m",[Relevance Date]);


Thanks
k0r54

View 2 Replies View Related

Subtracting Months From A Date In Query

May 30, 2006

I have a field called DATE_END_DEERS which is in a format of YYYYMMDD (20060530). I need to run a query that shows 6 months subtracted from this date. I can never get an answer that is even close. Can someone please help? ACCESS2000.

View 3 Replies View Related

Help With Query (make The Months Go In Order)

Dec 12, 2006

I have a little problem

I have an access database containing the following

LibraryYearMonthVisits
Lenzie1999Dec1095
Lenzie1999Feb789
Lenzie1999Mar1293
Lenzie1999Apr1526
Lenzie1999May1231
Lenzie1999Jun1171
Lenzie1999Jul1206
Lenzie1999Aug1287
Lenzie1999Sep1206
Lenzie1999Jan1451
Lenzie1999Nov1706
Lenzie1999Oct1414
Lenzie2000Oct956
Lenzie2000Jan1113
Lenzie2000Feb858
Lenzie2000Mar1110
Lenzie2000Apr1198
Lenzie2000May1203
Lenzie2000Jun1105
Lenzie2000Jul1152
Lenzie2000Aug916
Lenzie2000Sep985

As you can see the months are in order alphabetically. How can I fix my query so the months can be in the right order. Jan,Feb,Mar etc?

I imagine it is a simple procedure but I am not sure how. PLEASE HELP :confused:

Derek

View 3 Replies View Related

Date Query - Subtracting Months

Apr 10, 2008

Hello Everyone,I have a query where I am trying to pull records where the user took a class that is 2.5 years old or newer based on their license expiration date. Can someone tell me what I'm missing/doing wrong?SELECT tblCE_Details.LIC_NUMBER, tblCE_Details.Course_Code, tblCE_Details.Course_Date, sociwork1.expirat_dtFROM Sociwork1 INNER JOIN tblCE_Details ON Sociwork1.LIC_NUMBER = tblCE_Details.LIC_NUMBERWHERE (tblCE_Details.LIC_NUMBER = Forms![SW form]!SLIC_NUMBER) AND tblCE_Details.Course_Date >= (sociwork1.expirat_dt - Month(30))ORDER BY tblCE_Details.Course_Date;Thanks,Crhodus

View 3 Replies View Related

Date Order For Months On Query Results

Nov 30, 2005

I have a combo box that contains the months. They appear in month order on the form but when I query, they are in alphabetical. How can I get this to be in month order on the query?

View 2 Replies View Related

Query Customers That Havent Purchased In The Last Six Months

Nov 15, 2007

I have a database that i am trying to clear out old customers that have't bought something in the last 6 months.

I have a table with the customer details in and another table with the purchases in.

I have been using the folowing criteria:

Not Between Date() And #01/05/2007#

But i think this still still shows customers who have actually bought more recent than 01/05/2007.

Is there a way to just show customers who have not purchased anything within the last 6 months of the date the query is run on and to only show their last transaction date.

View 4 Replies View Related

Queries :: Crosstab Query Using Dates For Next 12 Months

Jun 23, 2014

I want to create a cosstab query with dates for the next 12 months accross the top as columns and employee names down the side as rows. I then want to populate with data showing what each person is programed to do under the dates. For instance trainer 1 is delivering training from the 23/06-30/06 then designing a course from 02/07-10/07. that type of thing.

I could represent an activity using a colour i.e. yellow for delivery, green for design etc.

Also do I need to create a table with all the dates? Is there a quick way of doing this?

View 7 Replies View Related

Queries :: Running 12 Months Query By Period Value

Oct 8, 2014

I'm having problems figuring this one out -- I'm fairly new to access. I have included a JPG attachment that shows the information I currently have in use and what I would like. I need a SQL statement that will generate the rolling 12 months by period.

The end results will be a table that is populated with the rolling 12 month values so I can qry a sharepoint infopath form to look up the rolling value (look up against lng_PERIOD and chr_EE_RACF) to populate the YTD values.

View 4 Replies View Related







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