Query For A Month Range Based On Combobox Entry
Aug 2, 2005
Hi,
I currently have a form that creates a report based on a query that takes in a start date and an end date.
What I would like to do is to create comboboxes that will let the user choose a month and year for the report.
Is there a simple way to choose an entire month in access? I've tried using the Month() function to no avail.
The SQL statement for where I select the start and end date is below:
WHERE ((([tblData].[EntryDate])
Between [Forms]![frmByRange]![BeginningDate] And [Forms]![frmByRange]![EndingDate])
Any help would be much appreciated!
View Replies
ADVERTISEMENT
May 23, 2005
Hi everyone, I am hoping to learn something new about access today. What I need is to be able to run a query that gives me rows of data based on paramenters that I specify. For example, I will query this all just on one table and I want to come up with an output that is in a nice format as follows:
Parameter..........................Member Count
01/01/04 thru 01/20/04...............298
02/01/04 thru 02/20/04...............287
03/01/04 thru 03/20/04...............301
04/01/04 thru 04/20/04...............254
And so on, usually for a calendar year.
Basically each member has an effective date, like member A might have 01/15/04 effective date and member B might have 01/02/04 effective date. I need to capture the count of members by month based on their effective date range. I would like to do it all in one query like above instead of just running a query for January, then February, then March, so on.
Is there a way to do this? Right now I am just running a query and getting one member count at a time and copying that number to an excel spreadsheet. it works okay, but is time consuming. I would rather semi-automate things for me. Any ideas?
Oh and I am new to access, by no means an expert, so be gentle with me.
Thanks,
Hanna
View 2 Replies
View Related
Feb 4, 2008
I have form with two date text boxes. One is start date and the other is end date. I want to query a table and only pull records that the date field is between the start date and end date.
my code I am working on is:
Dim startdate2 As String
Dim enddate2 As String
Me.start_date = startdate2
Me.end_date = enddate2
Dim SQL As String
SQL = SELECT FROM 'project' WHERE Date between 'startdate2' and 'enddate2'
DoCmd.RunSQL SQL
I am getting a error on the sql = statement, I can't seem to get the statement right.
View 4 Replies
View Related
Apr 3, 2007
I am very new to access so thank you in advance for your help and patience.
I have creadted a database for tracking students.
I would like to give them progress reports every three month based on thier start date (I have a 'short date' field for the start date).
If I run the query in January I would like results for all student who started in Jan, April, July & Aug.
Thank you again!
View 6 Replies
View Related
Dec 9, 2004
I am looking at creating a query which would report whether a specific field is yes/no. However, I would like it to based on that days specific month. For example, I have 12 check box fields, one for each month, and I would like to create a report where it would look up whether or not the current month has a check box in it. Additionally, I would like to create another where the criteria would require me to put in a month to search for. For example, to search to see whether or not december has been checked.
Tim
View 1 Replies
View Related
Mar 7, 2006
I am trying to make a query that finds all records by the "Month Number" and have problems.
What I did:
Month(DateField)
I got month numbers like I wanted but when I typed in the criteria below, I got February thru December Records, but when I search on anything "up to" 9 it works fine.
I want:
Between{month1] and [month2]
Month1= 9 (example)
Month2= 12 (example)
Need results to be from the requested months but any year
I have to imagine it's how the date is converted to an integer, but not sure.
Any help would be great!
View 4 Replies
View Related
Aug 6, 2014
I have a database that makes use of standing orders. That means that if a client has a standing order to receive products during for example 4 time as year (quartely at the end of the month). to automate the new entry by copying an old entry in the database.
Let's say I have a client where we will have to send a product at the end of June, it will look at a field where the next send date is, and when it reaches 2 weeks for that date, to create a new entry in the database based on that entry. This way, it will pop-up in our open cases and we are aware of it and also will be visible in our report.
View 1 Replies
View Related
Jun 19, 2007
Below is the code I have for a query that shows me the number of WorkUnits via a date range that is put in via calendars. This works great. It gives me one total for the date range. What I would like to be able to do is see the WorkUnit totals by month via a date range. If I put in the date range: Jan 1-April 30 I would like to get four WorkUnit totals instead of one. I would like to see the WorkUnit totals for each month. Can anyone assist with this? I asked a similar question like this yesterday but he SQL for this code is different and I have not been able to figure out how to apply yesterday's answer to this one. I have tried everything I can think of to no avail.
SELECT 'Total Work Units' AS FaultCategory, Count([WorkUnit]) AS [WU Totals]
FROM [Select Distinct [WorkUnit]
FROM WorkUnitsFaultsMainTBL
WHERE BuildID IN ("G004","E818","N005","F813","D024","C879") AND
PossibleCause NOT IN ("Out of Stock") AND
[TodaysDate] BETWEEN [Forms]![Queries_ReportsFRM]![StartDateTxt] AND
[Forms]![Queries_ReportsFRM]![EndDateTxt]]. AS vTbl;
View 2 Replies
View Related
May 17, 2013
I have a form that request information from the user (StartDate, StartTime, EndDate and EndTime) the problem is that it's not working. The only way I can get any data to show is when I remove the StartTime and EndTime. Only then will it pull the items from the StartDate and EndDate.
Here is what I have as my criteria: Between [Forms]![OpPROD_ALL]![StartTime] And [Forms]![ OpPROD_ALL]![EndTime] And Between [Forms]![ OpPROD_ALL]![StartDate] And [Forms]![ OpPROD_ALL]![EndDate]
The users will be able to request a report based on a start and end date along with a start time and end time.
Side note: this is to pull date for 3rd shift (Example) 4/14/2013 10:00PM - 4/15/2013 10PM
View 1 Replies
View Related
Apr 26, 2015
I am trying to use a combobox called Manufacturer to select which table the combobox called Model gets it's rowsource from using the code below.
Code:
Private Sub Manufacturer_AfterUpdate()
If (Me.Manufacturer.Value = "Siemens") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SeimensTable"
Me.Model.RowSource = "SELECT Model FROM SeimensTable"
Else
If (Me.Manufacturer.Value = "Samsung") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SamsungTable"
Me.Model.RowSource = "SELECT Model FROM SamsungTable"
End If
End If
End Sub
But when I run the form and select Manufacturer. Combobox Model remains empty. tell me what I'm doing wrong?
View 5 Replies
View Related
Mar 26, 2014
How do you put the Month on a form based on the data in a query?
View 1 Replies
View Related
May 30, 2014
I have a form where customer data is entered. one field serves as a criteria for a query. If, for example, A is selected in the form the query uses the criteria "A" in the X field f query. However, if B is selected in the form, the query uses the criteria "B" in Y field of query.
I can easily do this by setting up two queries and having criteria A run in X field of query and similarly for B. However, it seems as if there should be a way for me to have one query and simply use the criteria in a different field.So, is there VBA that will update a given query's SQL to use one criteria in one case and another critiera in another case?
View 1 Replies
View Related
May 25, 2012
I'm trying to create a combo list box in a form that has all 12 months (January, February......etc,) listed in rows, and depending on the selection will bring up only that particular month within a range of dates from a table. I don't want it to look at the day or the year, but only the month.
Example: I select January from the drop down list in my combo box and my form will display all records with dates that are in January regardless of month or year.
View 4 Replies
View Related
Jan 22, 2014
We have a ComboBox on a form with the months: Jan, Feb, Mar, Apr, etc.
We have fields in a budget table named: Jan, Feb, Mar, Apr, etc.
We want to create a query that pulls the correct field based on the value in the combo box.
This is what I have that doesn't work:
MyField: [Query1].[SumOf] & Forms![Main Menu]![test]
How to do this?
View 4 Replies
View Related
May 25, 2005
I have a query that selects usage records from a table where a data field falls within a rolling 12-month period that ends on a month and year selected by the user on a form.
PARAMETERS [Forms]![frmReport]![cboMonth] Short, [Forms]![frmReport]![txtYear] Long;
SELECT UsageID, dtUsage, dblUsage
FROM tblUsage
WHERE (((DateDiff("m",[dtUsage],DateSerial([Forms]![frmReport]![txtYear],[Forms]![frmReport]![cboMonth],1))) Between 0 And 11));
I also have a query that pulls data between two dates that the user specifies using two textboxes on a form.
SELECT UsageID, dtUsage, dblUsage
FROM tblUsage
WHERE (((tblUsage.dtUsage) Between [Forms]![frmReport]![txtStartDate] And [Forms]![frmReport]![txtEndDate]));
On the form I have an Option Group control that sets the visible properties of the 4 controls;
12-Month Rolling
cboMonth - Month Combobox
txtYear - User entered year
Date Range
txtStartDate - User entered Start Date
txtEndDate - User entered End Date
What I was planning on doing was adding two new textboxes (txtQryStart & txtQryEnd) and depending on what option is selected, change the dates accordingly
blnDateRange = (Me.optDate = 1)
blnMonth = (Me.optDate = 2)
If blnDateRange Then
Me.txtQryStart = Me.txtStartDate
Me.txtQryEnd = Me.txtEndDate
End If
If blnMonth Then
If Me.cboMonth = 12 Then
EndMonth = 1
EndYear = Me.txtYear + 1
StartMonth = EndMonth
StartYear = Me.txtYear
Else
EndMonth = Me.cboMonth + 1
EndYear = Me.txtYear
StartMonth = EndMonth + 1
StartYear = Me.txtYear - 1
End If
Me.txtQryStart = DateSerial(StartYear, StartMonth, 1) - 1
Me.txtQryEnd = DateSerial(EndYear, EndMonth, 1)
End If
Now I can use one query to accomplish both types of query;
SELECT UsageID, dtUsage, dblUsage
FROM tblUsage
WHERE (((tblUsage.dtUsage) Between [Forms]![frmReport]![txtQryStart] And [Forms]![frmReport]![txtQryEnd]));
This approach works. It saves me from having to duplicate the queries and some future headache if anything needs to be changed in the queries.
What I was wondering is there an better/simpler way to do this?
:confused:
View 2 Replies
View Related
Aug 19, 2013
I have a list of customers with multiple rent start and end dates. I need to create a query where each customer will have a record for every month/year between their respective rent start and end dates. I generally use macros but can't figure out a way to do it without VBA. My field names are Rent StDt and Rent EndDt. My query name is QCalcREndDt. I use version 2010.
View 6 Replies
View Related
Apr 15, 2013
I created 2 combobox that list specific table in a data base. I want to create an unmatched query based on the selection from those two combobox.
All field in those table are the same.
View 3 Replies
View Related
Apr 22, 2005
I have 2 comboboxes, the first one is called "activity", whereby I have 3 options to choose from, and the second is called "level".
When I click an "activity", for example Drawings, I want the "level" combobox to list a unique set of options for that category. and if I click on a different "activity" for example Planning, I want the "level" combobox to show a completely different set of options.
If anyone can give me any help on how to do this then I would be very grateful!!
Thanks
Angela :eek:
View 2 Replies
View Related
Jun 5, 2005
I am trying to create an Access application where income recognition is automatically calculated and stored at the end of the month based on established parameters. How can this be done? Does it require VBA programming?
View 1 Replies
View Related
Jan 8, 2006
Hello,
I am a little familiar with Access but having a problem figuring out how to alert a user that the date entered on a form is not the current month. I was hoping to have a warning msgbox pop up alerting the user. I am trying to prevent incorrect date entry.
Thank you very much
View 4 Replies
View Related
Feb 27, 2012
How to design a Query that will add a specific date to a Table every month?
In my case, I would like to add / append new record entries on the first day of each month - for example.
Do I have to start with a table that has ALL the future dates required, or is there any other solution?
View 3 Replies
View Related
Oct 24, 2006
I have a combobox with month names (january, february...december). This combobox sets the selection criteria for query.
1.How can I set the default value of combobox to actual month?
Thanks
edolelkes:)
View 2 Replies
View Related
Jul 8, 2013
I'm trying to create a table with an entry for month/day, no year. I want to create a report that can will sort the birthdays based on month in ascending order.
I'm currently using the text field to put in, "10/30" or "1/3" but when I try to order the dates, instead of "1,2,3,4,5,6..." I get "1, 10, 11, 12, 2, 3.." etc.
View 11 Replies
View Related
Sep 28, 2015
I have a database that is tracking attendance for several 100 employees. The Db is mainly used to log any policy occurrences (no call, no show). If an associate doesn't have any occurrences for a month, then they get a point credit. Right now, I set it up so the credit can be manually added. the problem is a supervisor (the user) may not know if their associate should receive this credit unless they review their attendance report. Opening the form to add a policy occurrence, then running a report to only re-open the same attendance form is inefficient. What I'd like to have is a way to have a credit automatically added if they did not receive any points for a particular month.
ps. My office does not allow uploading any data/files so I am not able to upload a copy/sample.
View 4 Replies
View Related
Jan 29, 2015
What I have is a single table that I need to create a report from. It has vehicle unit numbers, dates of service, repair details and costs. I am trying to generate a report where I can select a unit from a combobox and enter a date range.
View 1 Replies
View Related
Jan 25, 2006
I've tried searching the forums and haven't found quite what i'm looking for. I would like to be able to change the source for a combobox based on another combobox. The simplest way i can summarize that is i want to be able to choose A or B, depending on my choice i want another combobox to display all the values that A or B can have.
Thanks
Jim
I'm not sure I worded that very well. :(
View 1 Replies
View Related